50
$\begingroup$

My model has a clear plastic (or glass) dome with objects inside. The objects appear dark. I've tried the glass shader with color 100% RGB, with very small IOR, and using just a refraction shader.

I know Cycles has problems with caustics, but I just want broad illumination to fall clean through the glass. The light-to-column path can ignore refraction, but is blocked or tremendously attenuated. The camera-column path needs refraction, and seems to work fine anyway.

This demo image offers all optical paths of interest:

  • light upon object, seen directly
  • light upon object, seen through glass (looks okay)
  • light through glass onto object, seen directly. This is the shadow on the lit side of the column just below the glass tubing. I expect full illumination, but there is shadow. There is some light, but it's diffuse light from the floor.
  • light through glass onto object, seen through glass. This

White column and short glass pipe casting shadow

I did at one point try non-progressive rendering, and find extremely coarse light where there shouldn't be shadow, but this is not a practical way to make nice images. I've even tried cranking up certain sampling settings to many thousands, but still get bad noise though less, at the cost of long render times. I would like to finish my creations sometime before "Star Trek, the Generation After the Next" becomes real life, if you know what I mean. The next image is an example. I think Transmission in Sampling was 5000, but not sure.

enter image description here

I'm using Cycles in Blender 2.67 on a quad core Linux machine, 16GB RAM. Machine limits have never been a problem for 3D rendering.

Possibly, I screwed up some setting when I made my startup file, and just need to fix it. OTOH maybe this is just a limitation of path tracing, or of the way Cycles does it. If that's the case, what to real-world Blender artists do when they need to produce images on a budget and schedule? What is the practical real-world fix?

$\endgroup$

6 Answers 6

56
$\begingroup$

This may be caused by Cycles's rendering of caustics.

From the wiki, Glass and Transparent Shadows:

Glass and Transparent Shadows With caustics disabled, glass will miss shadows, and with filter glossy they might be too soft. We can make a glass shader that will use a Glass BSDF when viewed directly, and a Transparent BSDF when viewed indirectly. The Transparent BSDF can be used for transparent shadows to find light sources straight through surfaces, and will give properly-colored shadows, but without the caustics. The Light Path node is used to determine when to use which of the two shaders. Node setup

To clarify the node setup a bit:

  • The Light Path node determines the type of the current ray being traced. For each socket, it outputs a 0 if it is not that type or a 1 if it is. Thus, getting the maximum of those two values is equivalent to a boolean inclusive-or operation. The Maximum node will therefore output a 1 if the ray Is Shadow Ray or if it Is Reflection Ray; this will cause the transparent BSDF to be used (as it is the bottom input of the Mix Shader). Otherwise, it will output a 0, and the top shader (the glass shader) will be used.

The following diagram demonstrates some of the various ray types:

Ray types

  • The node setup used is part of a node group called "TrickyGlass," which you can see at the top. A node group is a reusable chunk of nodes that can be parameterized just like any other nodes – in this case, with the three inputs on the left – and output, in this case, a shader. Thus, you can use this setup in a node tree like any other shader node.

Here's an image using just a regular glass shader:
Too much shadow, before fix

And after switching to the TrickyGlass node group:
Just right, after fix

$\endgroup$
10
  • 8
    $\begingroup$ Usually it's nice to mix in some Fresnel into the transparent color, so it's less transparent on edges of objects which is a cheap way to fake caustics: youtube.com/watch?v=ALlP3GSrmK4 urchn.org/post/fake-caustics-in-cycles $\endgroup$
    – Greg Zaal
    Commented Aug 26, 2013 at 6:26
  • 1
    $\begingroup$ Also, is there a reason you use the Shadow and Reflection rays rather than the Camera and Glossy rays? I'm not saying it's wrong at all, I'm just curious if there's a difference. $\endgroup$
    – Greg Zaal
    Commented Aug 26, 2013 at 6:27
  • 3
    $\begingroup$ Reflection includes glossy and diffuse. We don't want camera. $\endgroup$
    – wchargin
    Commented Aug 26, 2013 at 17:33
  • 1
    $\begingroup$ Your answer was very helpful to me rendering an eyeball. It has a surface over the whole eye which was shadowing the iris and darkening it. Its a good technique because in real life there is no space between the surface and the eyeball but it tends to be modelled that way. $\endgroup$
    – beiller
    Commented Jul 26, 2014 at 23:04
  • 1
    $\begingroup$ How do I change the appearence of my nodegroups to the appearence you show there? $\endgroup$
    – Teck-freak
    Commented Jan 10, 2017 at 18:08
10
$\begingroup$

Another aspect to consider is the environment in which the glass is in. A perfectly black sky (as seen in your screenshots) is not very good for the glass to reflect/refract with. If you want realistic looking light interaction, consider adding mesh light emitters to mimic real light sources.

Consider setting up a studio-like lightbox, or use an HDR image to act as the sky.

$\endgroup$
8
$\begingroup$

Increase the bounces in your render settings light paths.

enter image description here

Basically each face is a bounce, the outside edge of the glass, the inside edge(if it has thickness), the pole, the ground. The bounces tell cycles when to stop following the ray.

$\endgroup$
2
  • 1
    $\begingroup$ I've cranked up bounces to 20. No difference. $\endgroup$
    – DarenW
    Commented Aug 25, 2013 at 16:12
  • 1
    $\begingroup$ @DarenW I struggled with this too for hours. it wasn't the bounces. I found that when the glass was solidified with the solidify modifier, it had "fill rim" checked. This changed the problem instantly for me. $\endgroup$
    – chase
    Commented Nov 18, 2015 at 4:16
5
$\begingroup$

Your glass is dark, or the space behind is dark due to your render settings.

You need to make sure caustics is turned on or the glass will be dark and will not transmit light regardless of your transmission passes.

enter image description here

I struggled with glass and water for some time as well, and unless you have caustics enabled it will never come out right or behave correctly regardless of what shader mix you use.

$\endgroup$
2
$\begingroup$

I didn't get any luck with the listed answers. Changing the transmissions settings in light paths fixed it for me.

enter image description here

Transmission: 8

$\endgroup$
-1
$\begingroup$

It's simple. Set Roughness value of Glass shader to 0.03, and Color Management to Log, and select a look. Be sure that glass is two-sided. I'm serious.

$\endgroup$
1
  • 1
    $\begingroup$ Well, cegaton's technique is helpful too, because if you use only mine, image is desaturated. Use both. $\endgroup$ Commented Jul 6, 2017 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .