Glass and light problems

I’m making a scene with a gasoline lamp, but I stumbled upon a strange problem, glass does not let light through as it should.
I applied everything I can remember to solve it, but noticed that disabling diffuse ray visibility makes it a lot better in terms of passing light through, though it should be transparent to camera rays.

Am I doing something wrong? Is there THE ULTIMATE solution to the glass problem?

I’m attaching screenshots with material settings and render result

Diffuse ray on


Off


Use “Is shadow ray” as your mix factor. Plug a multiply node into it which enable control of how much light passes through.

For other style of shadows, setup a manual glass; fresnel to mix between mix shader and glossy. The mix shader should have refraction in upper slot and transparent shader in lower slot with isShadowRay doing the selection. You get transparency based shadows as before, but the fresnel gradient is acting on in. Putting it at the end after glass makes the full object have transparent shadow (assuming cuastics are off).

Alternatively, still having the transparency at the end, feed it fresnel driven color. As always when dealing with fresnel and transparency, backfacing faces have to use 1/fresnel.

Example of the first approach:



Obviously not as good as real shadows, but usually better than the solid shadow you get from plugging transparency shader at the end with a fixed color.

It doesn’t work, no light passes through glass no matter how high i set multiply value

It seems this setup blocks light from the flame instead of letting it through

And still disabling diffuse rays in settings works best, but I can’t understand why

There’s also some trick I’ve done before where if you set the color values for a glass greater than 1, then you can get an additive effect instead of shadows. (Normally you’d want to have it clamped to 1 or below.) But you have to keep it on a low level. If you do it with multiple objects like that it can get weird with the scene lighting behavior. (Because it’s now multiplying the light going through instead of bumping it down.)

Remove the glass shader and replace with transparency and mix it with a gloss node for reflection, driven by a fresnel. The thickness of the glass causes a few more refraction and reflection bounces to calculate and the path may become extinct before resolving a solution, and there is some absorption. For a lamp like this, as well as architectural glass, the IOR is low or unnoticeable, and so you can get away with using the transparency node as described above. This will eliminate unwanted extra bounces of the path, and you will get the light to pass through as you want.

Glass is glass, meaning IOR of around 1.65±, architectural or not. The reason transparency can replace refraction is because the glass thickness in these cases doesn’t bend or vary in thickness, pretty much rendering the impact of the refraction “invisible” or at least insignificant enough to ignore. However, you can’t just simply replace refraction with transparency if using fresnel to mix the two, as backfacing fresnel does a proper job on refraction but for transparency you should use 1/IOR. Alternatively you could use a layer weight facing with a curve or power control instead of fresnel to mimic fresnel and not worry about the backfacing at all.

“It seems this setup blocks light from the flame instead of letting it through”.
You didn’t share the project or parts of it, so hard to check what is wrong in your setup. As you can see from the screenshot, light passes through just fine in my setup. And it also shows how to invert IOR for backfacing faces if using fresnel to blend. With transparency based fake glass, IOR has nothing to do with bending light, it’s only defining how the mixing curve looks. If you want a “solid shadow transparency control”, move the shadow handing mix shader to the end - fully white transparency would produce no shadow at all.

Not sure why your answer kind of ticked me off, but glass is around 1.52 for an estimate sake, depending on the type of glass…


You can replace it as the fresnel is defining the gloss node not the transparency, so you can still have reflection behave correctly, while giving the appearance of glass. You could set 1 on the IOR for the glass, but there is still quite a difference… glass on left transparency on right.


There is a big impact on lighting.



Glass


Transparency

So you can see there is a significant difference.

Plus refraction does define bending light passing through a transparent/translucent material as well as a reflective curve on a specular surface (due to how much light is bent through extremely short distances in the material), and at each bend it is calculated as a “bounce”. That’s why default transmission bounces in Cycles are set so high in order to guarantee that the rays exit.


https://en.wikipedia.org/wiki/Refraction
https://rmanwiki.pixar.com/display/REN/PxrSurface

I can’t understand why using an “Is Shadow Ray” lightpath with a multiply node isn’t working for you. This is a very simple test. Both spheres are identical, except that the one on the left has a solidify modifier (effectively making it hollow). Both have a point light in the centre of the sphere, the one on the left with a blue caste, and the one on the right with an orange caste.

Clearly, both are letting light through.

EDIT. There are no other lights in the scene. Just the two point lights.


EDIT2: There’s some de-noising artifacts above. This is the identical render without de-noising.


As far as blending goes, 1.65± is “good enough”. At least for me for window glass panes as I don’t know their coating, lamination and so on that would effect its behavior. Your table ranges from ~1.5 to ~1.8 excluding the extremes. The middle of that is ~1.65 and gives me “room to operate on both sides without going into 1.45 range”. It’s really not that big of a deal, and certainly not what “sells the shot”.

Refraction should produce 99.9% equal image to the transparency one (if quite thin and even thickness glass panes), if Cycles handled caustics well enough to be useful. But it doesn’t, and that’s why we use the transparency trick for shadows. Refraction is also computationally heavy, that’s why we use the transparency trick as a refraction replacement, but the fresnel mixing needs to be handled for backfaces to avoid total internal reflections which doesn’t work with transparency at all. See below, the fix node has been disconnected from the fresnel node for the upper spheres, making it go all wacky. Note that the bouncy parameters are high, so it’s not due to that. No clamping and 250 preview samples.