PREVIOUS < EXAMPLE 1 - The glass with water

EXAMPLE 2 - Water

Welcome to the second part of my caustic tutorial. Since you already learned how to setup the caustic in tutorial before, we will go faster this time. There are two examples in this part of tutorial. The first one is the caustics produced by the water surface and the second one will be caustics from reflective surfaces as mirrors or metal surfaces.

Load the second scene from the zip file, the scene02a.mb. The scene has two object, the transparent water surface and the floor which will receive the caustics. There is also one directional light that will be used to produce caustic. Material of the water surface has the idex of refraction set to 1.33 so that it refract the light rays when they hit the water surface. To see the effect of caustics I added some bump on it ... remember that this must be set if you want the caustic effect to apear like on the bottom in sea. So let's start...

If you render the scene at this moment it will look like this.

As ordinary it does'nt have raytracing and caustics turned on . So let's turn both of these on. First select the light and jump to it's attribute editor (Ctrl+A). Then go to the Shadow > Raytrace Shadow Attriubtes and set the Use Ray Trace Shadow on. Since we need to set the light as photon emiter, go to the mentalray > Caustic and Global Illumination section and turn on Emit Photons. If you render the scene at this moment you'll get the same picture as one above. To correct this we have to turn on the raytracing and set the caustics on. Open the Render View > Options > RenderGlobals (mentalray) > Quality section> press the box on the right of RenderQuality > when mentalrayOptions1 window opens, go to the Caustics/Global Illumination section and set the Caustics to on. Render again...

Why is the surface so white? Because of to bright caustics effect. To decrease the intensity of the caustics select the light and jump to it's attribute editor (Ctrl+A) then go to the mentalray > caustics and global illumination section. As you already know from the first part of tutorial, we can control the intensity with the exponent and energy values. This time we will experiment with both parameters. For this situation I'v set the energy value to 2000 and exponent value to 3.6. Let's make one quick test render:

Ok, now that we have satisfying intensity level of caustics we will continue to fine tune it to get the better quality of it. The next value with which we will play a little bit is Caustics Photons. I suppose you already know where is it. ;) Since the surface on which the photons are casted is pretty big, we must increase this value to very high levels. So let's make a few example images with different caustics photons values...


Caustic Photons 10 000 (Default)


Caustic Photons 30 000

Caustic Photons 60 000

Caustic Photons 100 000

It easier to decide which fits our need when we have few pictures like the ones above. ;) The rendering of all four pictures is relatively fast so we dont have to worry about that. As for the quality, yes the last one is the best one, but the third is also fine, so we will pick the value between these two. Let there be 80 000 photons. ;)

There are still few values we have to play with to get the better result. They are in Render Globals (mentalray) > mentalrayOptions1 > section Caustics/Global Illumination. Since we have very high Caustic Photons value we will increase the Caustics Accuracy to 100. This will collect more photons when calculating caustics and the effect of this is that the result is a little bit smoother. I also found out that if you set Caustic Filter Type to Cone you'll get rid of the noise and get much better result than box filter. Let's show these effects on next pictures:


Caustics Accuracy 64
Caustics Filter Type Box


Caustics Accuracy 100
Caustics Filter Type Box

Caustics Accuracy 100
Caustics Filter Type Cone

We will stick to the values from the last picture... now you can do a test animation if you want. You just need to animate the bump value on the sea surface. ;)

And that's it. Let's go to last section...

 

EXAMPLE 3 - Reflective objects

Now we will just show you one simple example of how caustics can be used with reflective objects. Just load our last scene (scene03a)...

In this scene I already set the light to cast shadow and to emit the caustic photons. I didn't set the caustics on in mentalrayOption1 ... you will do that, just after we do one qick render of the scene:

From the picture above you can see that we have three object in the scene, the sphere the wall and the floor. I'v set the wall and sphere to be reflective object. I suppose you already know how to do that... ;) Because they are reflective they will reflect the photons emitted from the light source and cast it on to the floor. Let's turn on caustics: Render View > RenderGlobals (mentalray) > Quality section > click on the box near RenderQuality > then when mentalrayOptions1 opens go to the Caustics/Global Illumination and turn on Caustics. Render again:

As you can see, since the wall has red color and reflective surface, it reflects photons from the light source and illuminates a floor a little bit. This is also happening with the sphere and the floor. The intensity of the caustics is driven by the few parameters of the objects material. These are the color of the object, the specular color and reflectivity. By increasing the specular color and reflectivity you'll get the brighter caustic effect, and by changing the color of the object you are changing the color of casustics. The picture below is one example of this ... I'v changed the specular to be brighter than before and as you can see it emits more red color on the floor.

That's it. The end of our caustics tutorial. I hope that I helped a little bit with these examples. I know that they are as simple as they can be, but it can be a good start for beginners in proces of learning how to use mentalray for maya.

Happy rendering, and bye till next tutorial. ;)


Toni Bratincevic - toni@interstation3d.com - http://www.interstation3d.com