Glass Material Camera Ray Issues

Heya!

I’m currently working on a architectual project where i’m having some issues with the environment lightning and glass material node setup.

So currently i have a node setup for the environment where the light source and background image (hdr, jpeg) are two separate things, where normally you have it in one and same image. I’ve setup my scene like this because i didnt find a HDRI image that really suited my archviz layout and where i had to turn up the environment light strenght so high that it ruined my “background image” and became completely white. So instead i took a node setup i found working where the background image is what you see outside the window and the environment lightning comes from another image which you really cant see (except reflections), and this is where problems starts to occur.

So this is my node setup for the environment and background image.


So what i really want to solve here and get working is my reflections in windows and glossy materials.

My questions is, can i change my node setup on glossy and glass materials where the reflections comes from the background image and not the environment HDR texture. I’ve tried alot of different setups on the glass material i have in the scene but it still doesnt work.

Here is an image of the glass node setup where you can see that the reflection in the glass is from the HDR texture.


I can see why this is happening and its not really weird because i’ve setup the world lightning to behave this way, but is there any solution to change its behavior on glass and glossy materials so that i can “sort out” which models in my scene should get the reflection from the env. light or backg. light. I might think that i have to change some things in the “camera ray, lightpath node” but i dont really know that to change?..

If someone need more explaning or something just ask… I’ts not really an easy thing to explain!

Cheers.

Your environment setup is as follows now (translated to “commands” for Blender):

  • For camera rays use the background image with the low intensity.
  • For any other ray use the bright environment.

And the last command is what causes your issues: Blender uses the bright environment for transmission (= refraction, e. g.) and glossy/reflection rays, too. You just need to tell Blender that it should use the low intensity background image for those ray types as well (just as you did in the material nodes by combining light paths with “Add”).

Here’s a simple example in which I used three environments in total (just to show the basic principle):

  • A pitch black environment just for the camera.
  • An outdoor HDR for the refraction in the glass.
  • A studio HDR for everything else, including general lighting and reflection.

See how the glass sphere refracts one environment but reflects another?


Alright thanks for the reply! I tried some different setup’s before your edit but didnt manage to get it working, all the math nodes i had got me extremely confused… haha but i will try this as soon as i got the time and see if it works!

I’ll come back with the details.

Cheers.

What you need is basicaly this setup:


You have two different lights with different intensities. You need to use the darker light for Camera rays but also for the Glossy and Singular rays. You can achieve that by using two Math nodes set to mode Maximum - in this mode the node outputs 1 if one of the output is 1. If both inputs are 0 it outputs 0. This way it works so that if the ray belongs to one of those three categories it uses the darker light, othervise (basicly only for diffuse rays) it uses the brighter light.