Tag: shader
Mental Ray – Ambient Occlusion Shader
by put3d on ก.ย..25, 2009, under 3ds Max Tutorials, Mental Ray, Tutorial

In 3dsmax7 Mental Ray 3.3 gained a new shader called “Ambient / Reflective Occlusion” what can this be used for? Well, traditionally within Mental Ray GI has been handled photon mapping and Final Gather. In this case a GI effect can be generated via a shader, and in this way this system opens up some flexibility in how you generate your GI.
So what does this shader do? Quite simply it shoots out rays from the pixel that is being shaded in a hemisphere based on the normal of the pixel. It then traces these rays to the scene bounds or to a fixed distance defined in the shader and if it hits a piece of geometry the ray is flagged as occluded. Mental Ray then works out the average number of rays that were occluded and uses this to work out a blend colour between the BRIGHT and DARK values setup in your shader. On the right is a diagram of a typical pixel being shaded.
In the example shown you can see that our shader has thrown out a total of 5 rays. If the BRIGHT colour were white, and the DARK colour Black, we would have two DARK rays and three LIGHT rays. So our pixel would be shaded as 40% occluded, or in other words a grey of 40% black would be used. Due to the way Monti-Carlo sampling works, 5 rays would not give us a very good average, pretty much in the same way as a sampling of 5 people in a survey would not give a very good average opinion of Mr man in the street. So for a better quality render you would expect to use 24+ samples.
goto Tut0rial :
http://www.christopher-thomas.net/pages/free_tutorials/tut_ambient_occlusion_shader/ct_tut_mentalray_ambientocclusion_shader.htm