“Caustics in MentalRay” by Toni Bratincevic
Ok, we have the refraction and shadow, now we need to get the caustic in the scene. To produce caustic effect, you must set the light as photon emitter and set the caustics on in mentalray rendering options. So select the light, go to the attribute editor (Ctrl+A) and go to the mentalray > caustics and global illumination section. Set on the Emit Photons option. The Energy and Exponent becomes available to adjust, but for now leave it as it is. We will use it later to increase od decrease the intensity of caustics. Now go to the RenderGlobals (mentalray) > mentalrayOptions1 > Caustics/Global Illumination and turn on Caustics option. If you render the scene at this moment you’ll get caustics effect in your picture, similar to this one:
As you see, there are some caustics on the floor in the shadow area, but there is something wrong. What? If you look at the picture from beginning, from real situation, you’ll see that we are missing the area pointed in the that pic. The problem in our renderer is similar to the one we met few moments ago when we turned on the refraction. Remember the ray depth? 😉 To solve this, in the mentalrayOptions1 at the Caustics/Global Illumination section set the Max Refraction Photons and Max Photons Depth to 6. Render again:
Here it comes. 🙂 But to intense. To decrease the intensity of it, go to the attribute section of the our spotlight, and go to the Caustics and Global Illumination section. If you remember, I mentioned before that we will use the Energy and Exponent value to decrease the intensity od caustics. We will make few pictures to show you what’s happening when we change these two values:
Energy 500Exponent 2
Energy 1500Exponent 2
Energy 3000Exponent 2
Energy 8000 (Default)Exponent 2
Energy 8000Exponent 2 (Default)
Energy 8000Exponent 2.5
Energy 8000Exponent 3
Energy 8000Exponent 3.5
We can get similar effect when we increase the exponent or energy value. In my opinion the value somewhere between energy 1500 and 3000 will be the most appropriate. So set the Energy value to 2300 and leave exponent to it’s default value (2) and do another test render.
The quality of the caustics are controlled by the few options in light attribute editor and in the mentalray render globals options. To set the number of caustic photons emitted from the light source, select the light and go to it’s attribute editor. Then jump to mentalray > Caustic and Global Illumination section. Let’s make a few examples with different kind of Caustic Photons:
Caustic Photons 3 000
Caustic Photons 10 000 (Default)
Caustic Photons 30 000
Caustic Photons 80 000
The first picture renders very fast but it doesn’t have the quality that we want. The second one is much better that the first, and it can be used for the final render. The third and last one produced the best caustic effect but with increased render times. Let’s make a little interpolation between the second and third picture, and set the photons to 20 000. This will be our final setup for this situation. There would be situations, like rendering the caustics from sea surface, when you’ll need to increase the caustic photons to higher values to get desirable result.
There are still few options that we are interested in, when it comes to quality of caustics. You’ll find it in RenderGlobals (mentalray) > mentalrayOptions1 > Caustics/Global Illumination section. With Caustic Radius you can control how big are the area that photons are collected from, and with Caustic Accuracy you can control how much photons are collected together when calculating caustics at point x of the scene. You will leave these two to their default values. Don’t worry about 0 value at Caustic Radius option … if it is set to 0, the renderer set the appropriate value of this option, and it does this very good in many situations. As for the other option, the accuracy, well you should probably leave it as it is, but if you increase the caustic photons to very high values you should also increase this option to higher value. Also, if you change the Caustic Filter Type from Box to Cone, it will produce a little bit sharper caustics effect.
So this is it… the end of our first session… let’s get in to the sea 🙂
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…
Latest Comments