Hi everyone, I've been working on an interior scene, and have hit a wall when trying to do the following. I have a background image that I am using to cover up the HDRI through the windows, which obviously blocks the light, so I used a light path node with a transparency to allow light through the background image. This allows the light to pass through, but if I have a reflective surface, such as a glass material or a mirror, the background ceases to exist on the other side of the glass, or in the mirrors reflection. I was wondering if there is a way to allow light through the object, but also prevent it from disappearing in reflections. I'll attach a few images of my node setup and the issue I mentioned. Thank you for all the help as always.
Node Setup, Proper Light, Wrong Background in Reflection:
Wrong Lighting, Good Background in Reflection:
Proper Light, Wrong Background in Window:
Wrong Lighting, Good Background in Window:
Hi dzcannon ,
There are several ways to go about this, also depending on what you want exactly...
For instance, you can use this Node setup for the BG Image:
You can of course also use an Emission Shader, in stead of a Diffuse for the BG Image...
Looking through the Camera, with these World Settings (I removed the window's shadow here):
I turned off the World Glossy, so it won't reflect in the mirror, but that will probably not be necessary for you, if your BG Image covers the whole window...
Explaining 'everything' about the Light Path Node might be a cool idea for the next Discord Q&A Livestream in November...
I think part of the problem is, that some (a lot of?) people don't know what the Camera Ray is. The Camera shoots rays in the scene. They are the Camera Rays, but as soon as they hit something, they change to other types of Rays. Maybe this helps a bit:
(This is like what you have in your third screenshot...)
The Viewport acts as Camera here. In the top, the monkey is hit by a Camera Ray and therefore blue, but in the bottom, the Camera Ray hits the glass and changes to a Transmission Ray, thus the Monkey is Transparent.
Thank you for the response Martin (sorry, ended up deleting my last response after some testing)! After some more thoroughness, I realized that all I need to do to get my desired effect was to disable diffuse, glossy, and shadow under ray visibility in object properties, and the same goes for the window. This gave me the exact effect I was looking for, where the light from the HDRI is uninterrupted by the background image or the window. Thank you again Martin for taking a look at my problem!
"Explaining 'everything' about the Light Path Node might be a cool idea for the next Discord Q&A Livestream in November"
I think this would be a great idea, would love a more thorough look on the light path node. Enjoy your rest!
Small Correction: I kept Glossy ON for the windows, which retains the reflection in the mirror of the background.
Yes, there are more than one way to get the wanted effect; disabling the Shadow Ray Visibility is the same as using the Is Shadow Ray in the Light Path Node (as far as I know).
Why you also need to disable Diffuse and Glossy I don't understand (but that's ok), has probably something to do with your specific scene set up.
I'm really glad it worked out!