Você está na página 1de 4

http://www.jhavna.

net/pdftutes/reflection_caustics/

Maya & mental ray Caustics Tutorial I

This tutorial will cover how to create simple reflective caustics in Maya using the mental ray renderer.
Reflection caustics are caused when light strikes a shiny/reflective surface and is reflected off the surface and in turn strikes another surface,
causing a specific light pattern to appear on the surface. I'm sure everyone has seen that already, so I won't go on.
Right, the image we'll be creating in the end will look like this:

Ok, so model your ring and a room then add a few lights until it looks like the image below:

[side view]
The bounding box or room doesn't have to be that high, I just chose that to allow me to position the camera better.
So, in order to make any use of this, let's set up out materials.

Ring:
Create a new lambert material in the hypershade and give it a name. Leave the default settings for the material. Now go to the material's

shading group (click on the in the attribute editor with the material selected). The only things we need to do here is assign two
mental ray nodes as follows:

Change the settings of the dgs_material to match the following:


The only important thing here is the specular colour. That's the colour the object will be when we render it out. This has no effect on the
colour of the caustics in the end.
Set up the dgs_material_photon like so:

Here the specular colour determines the colour of the caustics. So you can have a green object emitting red caustics if you wish. That's all for
the ring material.

Room Material:
For this I used another lambert material. You need to set up the room material exactly like that of the ring, except that the room will not have a
specular value, and that we set the diffuse value to the colour we would like the room to be (or floor). I chose a light gray. The same goes for
the dgs_material_photon node.

That's all for our materials, now let me explain the principle behind them. The DGS_material is the equivalent to a normal maya shader So all
it does it define basic material properties. The key part is the photon shader. This shader uses the photons produced from the lights (which
we will add shortly) and calculates their trajectory and various other attributes (colour, intensity/energy etc). So by giving the photon shader a
high specular value, it means that it will reflect most of the photons that hit the surface. The photon shaders are also necessary to actually
allow you to see the photons. If you were to remove them, there'd be no caustics.

Now we need to set up the render globals to render out our caustics. We need to do this before we set up the lights, else not all options in
the light settings are available to us. So open the render global window and set mental ray as the renderer. Click the mental ray tab and
scroll down until you see the caustics tab and expand that.
Enter the following values:
So, here we turn on caustics and set some values. I've upped the caustic accuracy and the Photon volume accuracy, to make the caustic
more defined, as well as increased the Max Reflection Photons value. Also turn on progress messages in the Translation tab, so you know
how the render is going ;)

Right, now to the lights. We need two lights, a spotlight and a point light. The point light is more for ambient light, it's the spot light that
produces the main reflection.

Once you've created the lights, you need to set them up. Let's start with the spotlight. Enter the data as below. The rest can stay.

Now we've told the spotlight to emit 200000 caustic photons, with a RGB energies of 200 each. You can turn down the number of caustic
photons, but it will reduce the accuracy of the caustic reflection. Have a play with this value and see for yourself. Just bear in mind: the bigger
the number, the longer the render time!
The point light will also emit some caustic photons, but not as many, as it won't be the main source of the caustics. It will however have more
energy, just to cause the room to brighten up a bit. See below for the setup:
Before we render this image out, we need to do one last thing. We need to attach the out message of the spot light to the dgs_material we
assigned to the room. So you open the connection editor and load the spotlight into the left pane and the dgs_material into the right. Connect
Message of the spotlight to the Lights of the material.

Now, hit render, wait and enjoy.

This technique can be uased for all manner of objects, like for example this cube:

Have fun experimenting with the settings and shapes....

I admit, the scene isn't a brilliantly lit example, but that's outside the scope of this exercise. It was just to demonstrate how to create the
caustic effect. The rest (ambient lighting etc) is left up to you.

Você também pode gostar