can someone explain whats happening with the refraction shader?

EDIT: So after hunting around some more, i see that the issue is that the refraction shader is not intended to be used on its own. I switched over to the glass shader and all is well (although i don’t get the gloriously fast / instantly clean render times that were so tempting with the refraction shader, but i guess thats the trade off). Anyway, included my initial post below for anyone who stumbles upon the same quandary in the future!

i’ve made a very simple scene to demonstrate. its a small cube with a refraction shader inside of a larger cube acting as a completely enclosed room. The world has a simple green background shader.

If the room is given a blue emission shader, the refractive cube refracts some black, even though all my bounces are cranked to 128, and after passing through the cube every refracted ray should be striking the blue emission colour.


Now even stranger, if i simply change the room shader from an emission shader to a diffuse shader, changing literally NOTHING ELSE, the interior all goes black as expected, but the areas that WERE refracting black previously NOW render the green environment colour that is outside the room.


can anyone explain what is going on??

a further note: i’ve played around in blender internal with equally simple refractive setups and i can reproduce the black refractions in the exact same way if i set my refractive bounces all the way down to one. the problem is that bounces are all cranked ridiculously in cycles, unless there is some setting that i am overlooking? (toggling shadows / no caustics in the light paths panel makes no difference either)


This might be the result of inverted normals of the cube, so check your normals :slight_smile: if that’s not the problem try a different blender version or share your .blend file so we can take a look

As you seem to have found, the refraction shader isn’t meant to be used by itself. You can reconstruct the result of the glass shader like this:


Except this has the added benefit that you can now define color and roughness separately for reflections and refractions.

Btw, IOR on the refraction shader and fresnel node should match for this to work 100% correctly.

Not only that, but you can control just how much reflection is in your custom glass shader (which you might want because people have had difficulties getting certain things like clear pool water with the normal glass shader).