2008年3月31日 星期一

Caustic example in maya


Glass Caustic render in Maya mental ray:
1: Get ready for model and one spotlight aim to glass model.
2: Apply mental ray's shader "dielectric_material" to the glass model, and set spotlight shadow mode by raytrace shadow. (if you render a preview now, will get some basic reflection and refraction with a plain shadow without any photon refration)
In order to let photon appear with shadow, need to keep work on couple things below:
3: In "dielectric_material" shader's ShadingGroup> Custom Shaders> Photon Shader to add new shader call "dielectric_material_photon" from mental ray shader library>Photonic Materials.
4: In "dielectric_material_photon" setting, set "Col": shadow's photon color, "lor": refraction rate (glass is around 1.52/ water is around 1.3)
5: On render setting> Caustics and Global Illumination> to turn on "Caustics"
6: On the spotlight setting>mental ray>Caustic and Global Illumination" to turn on "Emit Photons", "Photon intensity":18000~300000, "Caustic Photons": set the photon detail.
And you can do the preview render for the caustic result!
If you have missing the shadow that behind the front glass refraction, The problem you are having is due to the settings both in you Spot Light and Render Settings. To fix the issue you need to increase to Ray Depth Limit to 5 in the Ray Traced Shadow attributes of your light, and in the Render Settings increase the Shadows to 5 in the Raytracing section.
The reason why you need to make this change is because of the number of bounces the rays are doing in the scene. Your glass has both an inside and and outside, making 2 sides, times by the front and the back side make 4 surfaces the rays need to penetrate through. Therefore the Raytracing settings need to be set to 1 unit higher, hence 5. This allows for the 4 bounces plus 1.

maya_sample file

沒有留言: