Saturday, September 22, 2012

Light in Glass - Cycles

For this entry, we'll go over a trick for having a light shine through glass efficiently in Cycles.  For this example, we'll have a simple setup of a oval sphere emitting from inside a regular sphere (which has the glass material), and a torus around it to receive the light through the glass.

When normally just applying a Glass material to the sphere, the problem arises that the light cast on the surrounding area is very noisy.  This is due to the fact that Cycles is trying to do a lot of intense math to try to get the lighting realistic.  This method of rendering can take a very very long time.

The quick trick is to use the LightPath node combined with a Mix Color node set to Add and a Factor of 1.0.  When combining this with a Transparent Shader, the resulting render is one where the light coming from the emitter is correct as it passes through the glass to the camera, but for the light that passes through the glass to the rest of the environment, it's as if the glass isn't there, leaving much faster rendering times and much cleaner image.

New render with this more sophisticated node setup.

No comments:

Post a Comment