5
$\begingroup$

I'm playing round with a fairly common Cycles node setup for glass that gives the reflections of glass but without the darkness that you get with the default glass shader:

enter image description here

The left panel uses a custom 'fast glass' material (node setup below), and the right one uses just the default glass shader. While I'm expecting the double reflections on the left panel - since that's what happens with glass IRL - they seem really far apart depth wise. The glass is only 12mm thick, so I was expecting those two reflections to be almost on top of each other. Also, one of the reflections is noticeably larger than the other, which I imagine is also due to the exaggeration of depth. I'm stumped as to why.

Setup:

  • Both glass panels have had scale applied.
  • Both glass panels are closed meshes at 12mm thick.
  • Both glass panels are flat shaded, with normals facing outwards.
  • The default glass is using the default glass shader with an IOR of 1.450 degrees.
  • The 'fast glass' uses the following material:

enter image description here

Edit:

File uploaded here (swapped out the floor so I could drop the texture, but otherwise the nothing else changed):

Tinkering some more, I noticed that if I use the Shadow Ray and Diffuse Ray as my factor I get just the one reflection, so it looks very similar to the standard glass shader, minus the shadow. Interestingly if I use the glossy ray I get a lot of refraction going on, which doesn't seem right given the thickness of the material, but I can't begin to figure out why.

$\endgroup$
  • 1
    $\begingroup$ Could you upload the file for an easier understanding? You can use this link blend-exchange.giantcowfilms.com (if some textures, please pack them in) $\endgroup$ – lemon Feb 27 '17 at 17:15
  • 2
    $\begingroup$ Eliminating variables all together and removing the Light Path and Math nodes from the equation I think it may be something related to the Shader Mix or the Transparency shader and how they work internally. If you gradually increase it's value by hand you can actually see the reflections gradually growing apart $\endgroup$ – Duarte Farrajota Ramos Feb 27 '17 at 17:49
  • 1
    $\begingroup$ @Timaroberts The issue is not that the reflections are there, that is expected and wanted, the issue is that the reflections of each pane look unnaturally apart. Which doesn't happen with the pure glass shader. It is probably an expected side effect of the "cheating" we are introducing into an otherwise physically correct system. $\endgroup$ – Duarte Farrajota Ramos Feb 27 '17 at 17:53
  • 2
    $\begingroup$ @DuarteFarrajotaRamos You're onto something: setting the mix of glass and transparent to 0.5 -- or anything between 0 and 1 -- seems to increase the refraction, which is in turn affecting the reflections. I'm guessing that somehow the mixing the two shaders together messes up how Cycles calculates IOR? Baffling. $\endgroup$ – Dre Feb 27 '17 at 18:00
  • 2
    $\begingroup$ It seems to be specifically the inclusion of Reflection Ray into that calculation that breaks the IOR. If you plug just the Shadow Ray input into the mix node directly (bypass the Math node) the results are what you would expect. If you plug Reflection Ray into the mix node directly, you get the odd double reflection. Not sure why, but including Reflection Ray in that calculation breaks it. $\endgroup$ – Lewis Feb 27 '17 at 20:49
1
$\begingroup$

The problem is that the Mix node using the 'is Reflection Ray' is causing the glass to behave as a single refractive surface - which doesn't exist in the 'real' world. Normally the refraction would bend the light one way on entering a solid and the other way on exiting the solid, effectively cancelling each other out.

However, I believe the Mix node is resulting in rays entering the glass and being refracted as normal, reflecting off the back surface of the glass, and then passing out of the front surface of the glass without refracting back the other way.

In order to demonstrate this, change the color of the Glass Shader to give the light that passes through it a tint to make it identifiable to that reflected off the surface. Also, increase the IOR to make its effect more pronounced. You should get something like the following :

reflections

As you can see, the 'untinted' reflection is the same as that on the surface of the other pane. This is not passing through the glass and is not refracting - it is simply the reflection off the surface of the glass.

The 'tinted' reflection is entering the glass and reflecting off the back surface. However, it is not being refracted at both surfaces - only one since the Mix is causing the surface to behave as Transparent on one transition - and this is causing it to act as a lens.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.