Reflection of Object Not Visible After Using Light Path Node

Question Lighting

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 Background.png

Wrong Lighting, Good Background in Reflection:

 Good Background.png

Proper Light, Wrong Background in Window:

rong Background2.png

Wrong Lighting, Good Background in Window:Good Background2.png

  • Martin Bergwerf replied

    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:

    Light_1.png

    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):

    Light_2.png

    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...


    1 love
  • Martin Bergwerf replied

    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...)

    ight Path Node_1.png

    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.

    1 love
  • Martin Bergwerf replied

    Well, it seems, that you don't even need the Backfacing, just the Is Shadow Ray in the Light Path Node does the job already:

    BG.png

    I will try and explain a bit more tomorrow (getting tired now...)


    1 love
  • Michal Dziewiatkowski(dzcannon) replied
    Solution

    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.

  • Martin Bergwerf replied

    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!

    1 love
  • Omar Domenech replied

    Also great Why Blender Why subject. This is going to get logged in. This was some advance stuff.

    1 love
  • Michal Dziewiatkowski(dzcannon) replied
    A bit more context on why I disabled Diffuse and Glossy from the background: when I left them on for the background, they would cause odd shadows in the scene, and would alter the lighting slightly, I'm guessing it has something to do with the bounce lighting. Also a small correction for the windows, I kept glossy ON for the windows, or else the mirror loses the reflection of the background.
  • Martin Bergwerf replied

    Thanks!

    I think I understand now 😊