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.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

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.
Check out the Terragen Community on Facebook: https://www.facebook.com/groups/Terragen.Galleries/

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
Check out the Terragen Community on Facebook: https://www.facebook.com/groups/Terragen.Galleries/

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.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

cyphyr

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

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

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.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

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.

WAS

Check out the Terragen Community on Facebook: https://www.facebook.com/groups/Terragen.Galleries/