Well, as you might have guessed, caustics converge very slowly in cycles- meaning, if you want them to look good, you will need many samples to get rid of fireflies. Clearly this is why the ‘no caustics’ button is available in the renderer- a must if you’re using cycles for animation.

But: shadows from e.g. a glass monkey look awfully dark without caustics. Witness here:

So what to do? An ‘obvious’ trick is to use the incredible ‘light path’ node in the material node editor. Mixing a transparent shader and a glass shader using the ‘Is Shadow Ray’ output means that only shadows will use the transparent shader, while the rest will use the glass shader. This allows us to dial in the opacity of the shadow by varying the darkness of the transparent shader. Cool!

But, in the back of our minds, we all really regret missing those caustics. Enter the trick discovered on BA for making lights: use the dot product of the incoming and normal rays (this is basically getting the angle between the normal and the light ray) to a ramp. The multiply node allows to increase or decrease the intensity. Voilla! totally unphysical, yet very acceptable caustic effects, without the fireflies.

pretty good looking. It’s not ever going to look exactly like the real thing (obviously) but it is usually enough. The node tree for the setup? A mere bagatelle:

8 comments
  1. Ben Dansie says: November 26, 20128:32 pm

    I love it when these tips come through right before a project that needs them. :) Thanks for the heads up.

  2. Bassam says: November 27, 20124:14 pm

    Great :) Nice coincidence, hope to see what you’re working on.

  3. sakrecoer says: January 20, 201310:42 am

    Thanks alot!!

  4. Piotr Arłukowicz (piotao) says: January 26, 20135:50 pm

    Indeed this is a brilliant and surprising good hack! I’d like to add, that after testing I’ve found that you can also put a Normal Node to some of the vector inputs, just to be able to rotate the light with diffrent angles.

  5. Bassam says: January 26, 20138:16 pm

    thanks! Yeah, that’s a good idea.

  6. Greg says: February 1, 20139:00 am

    I think the Facing output of the layer weight node does exactly this

  7. Bassam says: February 1, 20137:39 pm

    Hmm, Couldn’t replicate with the layer weight node in a quick test (admittedly, didn’t try long). I’d love to see an example file if you can make it work.

  8. Shader Forge: Bodies of Water | Chris Georgakas says: September 23, 201410:42 am

    […] seen in swimming pools. In lesson 3 you will see a clever technique for faking caustics (credit to Bassam Kurdali) to achieve both faster render times and additional artistic control. The first half of the lesson […]

Submit comment