Is there a way/hack to turn off self shadowing but keep cast shadows.

Started by cyphyr, January 14, 2020, 03:05:21 PM

Previous topic - Next topic

cyphyr

Is there a way/hack to turn off self shadowing but keep cast shadows.

I don't think this can be don't but a cleverer head than mine (that's everybody) may know better.

I want to cast a shadow on a terrain from an invisible object.

The sequence has already been rendered but the client wants to put a new object in it.
I can render the object separately but the shadow needs to be comped into the existing render.

The simplest solution would be to put a flat white shader (lambert) on the terrain and cast a shadow into that.

This could then be inverted and multiplied over the existing render.
Job done.

However as the terrain is lumpy and has rocks and displacement it is casting shadows onto itself.
Therefore if I use the above technique the existing shadows will get doubled up.

If I could turn off self shadowing then the only shadow I would have on my terrain would be the shadow cast by my object.

I'm pretty sure this can't be done but there may be a hack I don't know about.

Any ideas?
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

WAS

Quote from: cyphyr on January 14, 2020, 03:05:21 PMIs there a way/hack to turn off self shadowing but keep cast shadows.

I don't think this can be don't but a cleverer head than mine (that's everybody) may know better.

I want to cast a shadow on a terrain from an invisible object.

The sequence has already been rendered but the client wants to put a new object in it.
I can render the object separately but the shadow needs to be comped into the existing render.

The simplest solution would be to put a flat white shader (lambert) on the terrain and cast a shadow into that.

This could then be inverted and multiplied over the existing render.
Job done.

However as the terrain is lumpy and has rocks and displacement it is casting shadows onto itself.
Therefore if I use the above technique the existing shadows will get doubled up.

If I could turn off self shadowing then the only shadow I would have on my terrain would be the shadow cast by my object.

I'm pretty sure this can't be done but there may be a hack I don't know about.

Any ideas?

Have you tried a sphere at planetary scales, with cast shadows turned off?

Nevermind, I think I see the problem. Even with cast shadows disabled, the terrain seems no different then the planetary terrain. Even with the sun not casting shadows on surfaces, it's the same deal. Very interesting.

WAS

If Matt could return to this problem, it would definitely help these situations. I found this older topic: https://planetside.co.uk/forums/index.php?topic=20472.0

cyphyr

Yes I did wonder about using a sphere but ran into the same issue as you.
There is also the Shadow Catcher node which I think is what is referred to in the link above but that still seems to be effected by self shadows.

Hmmm
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

cyphyr

Ah!
Actually works just fine ... see attached
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Matt

Nice to see that this works! Using the Sphere instead of the Planet because the Sphere has the ability to disable shadows.

To get a clean black and white mask you should also disable the atmosphere (or the planet), because it casts a volumetric shadow that tints the shadow catcher.
Just because milk is white doesn't mean that clouds are made of milk.

cyphyr

www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Matt

Yes, that's the shadow of the atmosphere, so you'll need to disable the atmosphere (or the planet).
Just because milk is white doesn't mean that clouds are made of milk.