When "Is Shadow Ray" even works? (Solved)

Light Path - Is Shadow Ray returns zero for me, both in Eevee and Cycles. Can it even be used as I want (in this case - color the shadowed part of material differently)?

1 Like

So I got that this setup only changes how the object is “seen” by other objects. And since shadow rays aren’t meant to be affected by color of a shadow caster, it has no effect. Well, that complicates things

Red object casts the same shadow as white object. I believe shadow rays make sense only when light goes through the object, so it has to be somehow transparent.

Samples are supposed to detect light only, so this way the shadow will be unrealistic and brighter, because red is additional light.

It’s still possible to emit negative light :smiley: But this does not work with Is Shadow Ray.

2 Likes

Thanks. At least coloring a shadow can be solved through transparent BSDF mixing as you’ve shown. Any chance we can use received shadow as a mask for material parameters, such as normal map strength or whatever? From Light Path functionality, the answer seems “no”, but perhaps there is another hack?

You can only use it to change the colour of the shadows that the object with the “is shadow” material casts.
(not the colour of the shadows in receives)

1 Like

Thanks. That’s unfortunate

I think it has to do with the fact that Cycles (and Eevee) are not “bidirectional” but don’t quote me on that it, is more of a guess.

1 Like

Hello,
If I understood correctly, this can help you, you can always bake the shadows to use it as a “Mask” or something …

1 Like

Okay. Can use it if the light source doesn’t change the position

An idea that comes to me, using a “Shadow Catcher”, it can be used in compositing, there is a “Shadow Catcher” pass.
For still and animated …

And then I’ll need to render 2 more passes with different materials and compose them based on shadow catcher?

For Eevee rendering, you might want to take a look at the GooEngine fork.

It has a shader node that can split the cast, self-cast, and received shadows. (Also has light groups, which are quite nice.)

3 Likes

It looks like I’ll have to deal with this Goo engine if I want “pseudo 2d” rendering. Thanks

1 Like

It is actually on my bucket list to get this engine after hearing it from its creator on youtube, and I didn’t know it could do this. Since with npr, separating layers is so important, this would be very helpful (especially for form shadows of the 3d models).