Thursday, March 24, 2011

Caustics through Mental Ray in 3dmax 2010


Hi all,

 What are caustics ? Caustics allow us to simulation of transmission of lights through the transparent material or refractive material or reflected off over the surface, it'll work well with surfaces like glass, water reflections. Caustics are really great light effects that we can observe in liquids, glass objects and gems .In this tutorial , we are going to simulate the caustic effect of a glass.

Step 1 :

Here is the my scene, i have modeled a simple glass using lathe tool and i have a camera. scene have two lights, one is a omini and other one is a spot light  with default options with shadow map.



Step 2:

OK, first we need to enable mental ray as  our render. To do that goto Rendering menu---> Render Setup--> ,now dialog box will appear, under common tab scroll down to bottom and under assign render click on the box in front of the production and assign mental ray render.





Step 3:


 Next , to simulation of caustic effect , we need to have transparent or reflective object , lets assign a transparent material to our glass. goto---> Render -- > material editor ( or press 'm' ) .




Step 4:


Select avialble slot and click on "Standard " button , from map list select " Arch & Design (mi) " as show below.



Step 5:

From template drop down menu , select "Solid glass material", assign this material to our glass.




Step 6:

Make a test render ,Still no caustic effect.



Step 7:

To enable caustic effect goto--Render Setup --> goto Indirect Illumination tab. under
this tab select , scroll down and click on the caustic radio button. make a test render .

Step 8:

You'll see error message as follows, this tells us that our scene has no any caustic generating objects by default this is disabled. We have to enable it by ourseleves.

Step 9:
Select glass object  ---> Right Click --> Object Properties. goto mental ray tab and put a check infront of the "Generate caustics"

Step 10:

Make test render, you'l see a little bit ''caustic effect".

Step 11:

In order to enhance our caustic effect, select the light source ( in my case , it's spot light ) and goto modifier panel. Under "mental ray Indirect illumination " tab,  override the automatically process by enabling "Manual settings" , as shown below.


Step 12:

Increase the amount of  Energy , i choose 500000.0. make test render.

Step 13:

Now we have to increase the no of Caustic photons in order to smoothen our scene. to do that increase the no of Caustic photons , this value will depend on the how much big is your scene. I choose 1000000. make a test render.



Step 14 :

Now it's getting better, but not that much, in order to get a more realistic look we have to select "render filter size" properly. To do that goto "Rendering menu ---- >Render Setup " ( press F10 ) . Select indirect illumination tab. Scroll down , under caustic effect , change the filter size by enabling "Maximum sampling size" as shown below. Change radius value and make test renders , find a suitable value,  i choose value 3.0.Increase Sampling radius Value  so that our caustic photons will be smoothened out .

Also change the filter type to "Gauss" type.

Step 15:

Here 's the final output .


Tips :

 -  No of caustic photons will depends on the scene , hence always keep on increasing until , you find a good output .

 - Change the shadow type to "mental ray shadow map"

Samples Images :


















Wednesday, March 16, 2011

Setting up HDRI based lighting in Mental Ray

Hi all,
 In this tutorial we are going to look at how we can use  Final gather & HDR maps to create image based lighting scene.

Step1 :

This is the scene that i am going to work with, It's simple setup teapots with some architectural maps.
Ok lets' start first we need to create sphere to work as our environment , go top view  , go to primitive section create a sphere. make sure that it'l cover our scene fully.



Step 2:
Ok , lets apply texture to our sphere. to do that go to material editor ( press m) , select available slot and change it diffuse color and ambient color to black.


Step 3 :

Click on global illumination field, put the check mark and put a bitmap into self illumination field. Apply a HDR map as your bitmap , when importing the HDR map, put the check box in 32 color data field as shown below.




Step 4:

And assign that texture to our sphere.

Step 5:

To add more details to our scene, goto render settings ( press F10), and under Indirect Illumination enable Final gather. ( make sure that you have change your render as the mental ray) . make a test render ( press F9 ) , you can see much more realistic scene.


Step 6:

but we have lot of lights , to override this effect add Standard omni light in scene. make it intensity to lower value ( 0.2 ) .


Step 7 :
 To make more realistic . goto our final gather settings and we need to adjust some parameters to yield a high quality scene.


Step 8:

After some tweaks i get a following render output. Also further we can add some exposure control to our scene.

Step 9 :

To add exposure control goto rendering menu----> exposure control. choose mr Photographic Exposure control


Step 10 :

make some tweaks to parameters as shown in below.


here some example by using several HDR Images.