1
$\begingroup$

I have been experimenting with refraction shader and glass shader (using cycles render) and i noticed that a sphere with refraction shader looks almost the same compared to a sphere that has glass shader. 1)The only difference i noticed with the refraction shader compared to the glass shader is that when a light ray enters the material (that has refraction shader applied), the light ray ,that enters the material, changes once direction because of the ior (but cant bounce back) and when the ray exits the material it can't bounce back ,inside the material, but it can still change direction(because of ior) when it comes out. Can someone help me spot out the difference? Is 1) correct?

$\endgroup$
9
$\begingroup$

Firstly I'd like to point out that shaders are called BSDFs in cycles, and raytracing in general.

The difference is that the glass BSDF is essentially a mix of a refraction BSDF and a glossy BSDF - it reflects light as well as refracting it. The glass BSDF is designed to make glass and similar materials easier to simulate - otherwise you would manually need to mix a refraction BSDF and a glossy BSDF.

Some quick example renders (the darker is refraction): Refraction Glass

You can see the similarities in that the Glass shader is the refraction shader with some more bits added. Note the weird black artefacts in the Refraction BSDF, whereas the Glass BSDF has the rays bounce off the interior more realistically. For an even more realistic shader, you would want to mix a Refraction with Glossy BSDF - the Glass BSDF is just intended to be easy to use and do what the name says, AFAIK. (Edit: a glass BSDF is extremely similar, or possibly identical, to a refraction BSDF mixed with a glossy BSDF with the factor set to a fresnel node. The fresnel node returns values based on the angle of the surface to the camera. If you want to simulate glass and have more control over these kinds of things, this might be a better setup, although if you're just beginning to use Cycles then glass should do for now.)

Here's a picture showing two cubes with those two different materials applied, but with the same final result (one is a Refraction BSDF mixed with a Glossy with a Fresnel node as the factor, the other is a Glass BSDF):

updoot pls

If I had set up the scene better and put another object next to the cube you would see it reflecting off the glass BSDF but not off the refraction.

I can't offer an explanation for the black bits in the Refraction BSDF, but I suspect it has something to do with the way the renderer processes internal light bounces. Edit: I believe that the refraction BSDF is casting a shadow on itself.

TL;DR (for those of you with really small screens): A glass BSDF is a refraction BSDF plus reflection.

$\endgroup$
  • 1
    $\begingroup$ Black parts are likely because the number of bounces in the render settings is set too low. $\endgroup$ – Sazerac Aug 26 '16 at 1:52
  • $\begingroup$ @Sazerac I tried cranking up the bounces to 400... nothing. As I have said in my answer I believe it is internal shadows. $\endgroup$ – ChiCubed Aug 26 '16 at 11:12
  • $\begingroup$ The black spots are a result of internal total reflection. The Glass Shader has no light escape from below there either. What you see in those spots is pure reflection, no light from refraction. The Glass shader ought to behave exactly like a Glossy and Refraction shader mixed together with a Fresnel node of the same IOR. The Refraction shader just doesn't show any reflection at all, and so it's black where that's the only contribution. $\endgroup$ – kram1032 Aug 23 '18 at 21:31

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.