Wednesday, August 17, 2011

Model a Realistic 3D Diamond Using Mental Ray

In this tutorial you will learn how to model a 3D Diamond in 3dmax using  simple polygon techniques and  render with mental ray.

1. First go to shapes -> under splines sub category select "NGon " shape. In the perspective viewport make a shape look like this.

2. Select our shape go to--> modify panel--> change following parameters.

3.Lets extrude our NGon shape with following parameters. To do that select our shape go to modify panel, and apply "Extrude" Modifier and give following parameters.

4 Next apply "Edit Poly" modifier. Go to Vertex sub-level and select all vertices in the bottom and scale down like this.


5.After vertices scale down which means when they are close enough use "Weld tool " to weld them together.To do that select bottom vertices and under edit vertices tab, select weld settings. Increase the weld threshold until as the below picture.


6. Next goto sub level- polygon and select top polygon and extrude little bit as the below picture.

7. Afterwards extrude it again to a higher value as you can see in the picture.( Amount of extrusion depends on the size of your model)

8. With out changing selection change sub-level to vertices and scale down top vertices again to around 50%


9.Next lets make some tweaks to  our diamond . First select cut tool. go to Top- View create two squares as the below picture.



10. Next step is connect vertices around as the below picture



11. Select some polygons and delete them. so now you will have a hole in your model.


12. To fill the hole, In the "Edit Poly" change your sub-level to "Border" and select border around removed polygons and use "Cap" tool to fill the holes.


13. After some tweaks here is our final model of our diamond

14.Ok , Now we have finished our first part of the tutorial. next lets make our diamond looks more realstic by adding materials, lights and rendering techniques.
15. I have prepared my scene as follows (you can download from here).

http://www.fileserve.com/file/nbtz7D2/Scene_Files.rar


16. First change the render from scan-line to Mental Ray render, to do that open render setup dialog box ( Rendering---> Render Setup)

On the common tab, scroll down to bottom , under Assign render change Defualt scan line render to mental ray render.


17. Lets create our diamond material , first go-to material Editor( press M or Rendering-->Material Editor)
and assign a material to our diamond. Change the following parameters of the material.


A. Change type of material to Standard to "Arch & Design".
B. Set "Transperancey - 1.0 ". Change "IOR - 2.42"  and "Reflective to 1.0".
Also Under BRDF tab- select "By IOR " .


18. To make scene illuminate create a skylight, to apply skylight-->
A. Crate--->Light--> Starndard Lights--> Skylight


B. Change color of light to white
C. In order to use Skylight with our metal ray render , enable the "Final Gather".( Rendering -->Render-->Indirect Illumination--->Final Gather-->Enable)






Now make a test render.


18. Change the Background color to white.
19. To make diamond more reflective add some "Black Objects" to our scene (  Because our background color is white ). Here i have added the set of boxes and applied a black material.
20. To produce specular highlights, lets add more lights sources to our scene.create set of omini lights and change multiplier of all Omini lights to 0.2
21. Turn diffuse effect off so omini light will affect only the specular characteristic( Omini-->Advacned effect-->Affect Surfaces-->diffuse) Untick the diffuse option.































Make sure that your omini lights are place in a random manner.
22. Finally lets increase the relasim by enabling caustic.Select all omini lights and our diamonds and right click --> properties--> Select mental ray tab-->Check on "Generate Caustics On"


 To enable caustics rendering settings  (Rendering > Render... > Indirect Illumination > Caustics and Global Illumination (GI) > Caustics > Enable)




After making some tweaks final result will be like this.( To learn about mental ray caustics check my   previous tutorial)




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 :