Page 1 of 1
Shadow catcher material interfering with HDRI reflections
Posted: Tue Apr 14, 2020 2:43 pm
by nomojosh
Hi, using C4D plugin, I've notice that if I try to catch shadows the HDRI reflections seems to shift causing incorrect/offset reflections.
This is repeatable when using either a matte material
("shadow catcher" under common tab) or using the render layer system
(with the shadow catcher material).
The object catching the shadows is a simple plane (though it happens with any geometry including a cube or C4D floor object)

- incorrect reflection
Below are the correct reflections when no shadow catching material is applied or the floor object is hidden from camera.

- correct reflection
Any idea why this happens?
Thanks
Re: Shadow catcher material interfering with HDRI reflections
Posted: Tue Apr 14, 2020 9:41 pm
by frankmci
That's odd. Can you upload a very simple scene that demonstrates the behavior? The presence or absence of a shadow catcher shouldn't distort the environmental reflection.
Re: Shadow catcher material interfering with HDRI reflections
Posted: Wed Apr 15, 2020 8:22 am
by nomojosh
Sure, I've attached a simple scene using a free HDRI.
I think I've figured it out though... it's bringing the "floor" of the HDRI up to meet the contact shadow. Without the shadow catcher material, the object is in the centre of the HDRI.
Do you know if there's a way to stop that behaviour?
Note, I've compressed the HDRI to jpg just to share here. If you'd like to test with the full depth image, you can find it here: https://www.maximeroz.com/hdri-free-pack
Octane 4.05 | C4D R20
Re: Shadow catcher material interfering with HDRI reflections
Posted: Wed Apr 15, 2020 5:20 pm
by frankmci
nomojosh wrote:I think I've figured it out though... it's bringing the "floor" of the HDRI up to meet the contact shadow. Without the shadow catcher material, the object is in the centre of the HDRI.
Do you know if there's a way to stop that behaviour?
Oh, ok, I misunderstood what you were talking about. In the two images you posted, the reflected environment changes from having the window, table, chairs and doorway look pretty far away to looking much closer. That shouldn't happen, and it does not happen for me in the shared scene you uploaded. Yes, the shadow catcher does show up in the reflections as if there is geometry that more or less matches the environment there, and as far as I know that is intended. This makes the reflections more accurate, as various parts of the environment should be changed/occluded, as you can see in the renders below. As far as I know, there's no native way to disable the reflection aspect of ShadowCatcher enabled materials.
I thought Calus' amazing RaytypeContribution OSL
viewtopic.php?f=21&t=71597#p362867
might do what you want, but I just tried it, and enabling ShadowCatcher on a material seems to bypass the functions of the OSL node, unfortunately. There's also the other RayType OSL, but I suspect it will also be overridden.
Off the top of my head, if you want a shadow catcher but not have the shadowcatcher influence the reflections, I think you'll need do it in passes and comp them in post. I could very well be missing something, though. Maybe someone else has a good suggestion.

- No Catchers

- With Catchers

- Catcher Geometry
Re: Shadow catcher material interfering with HDRI reflections
Posted: Fri Apr 17, 2020 6:26 pm
by nomojosh
Thanks for the reply. I managed to get around it using an OSL node in the opacity channel of the shadow catching material (it was mentioned in another topic on here recently).
It meant I could use render layers and remove the shadow catching geometry from the reflections.
In production, I image we'd actually sit it on some geometry, but this resolve the issue I had here which is fine for look dev.
I can see why the shadow catcher moving the HDRI would be useful if you have a large open expanse, such as a car in a field. You'd want the car to appear to be in contact with the ground so it makes sense.
Re: Shadow catcher material interfering with HDRI reflections
Posted: Fri Apr 17, 2020 6:53 pm
by frankmci
Funny, that's the other RayType node I mentioned, but didn't think would work! I should not have assumed.

Glad it worked for you.