Adverti horiz upsell
Fluid Caustic Volume Shader Setup for Maya 2014
Fluid Caustic Volume Shader Setup for Maya 2014
david allen, updated 2015-02-05 07:41:23 UTC 58,179 views  Rating:
(4 ratings)
Page 4 of 8

4. Photon boundary cube volume shader

In order to avoid calculating caustics in infinite space, mental ray requires defined 3D volumes in which the photons will will be contained. In the case of this tutorial, we will be using the Photon Boundary Cube with a “parti_volume” shader. This same shader will also be applied to the camera and the water surface in future sections of the tutorial as well.

NOTE: It is really important to set up all the shaders BEFORE you start casting photons into the scene and trying to render. If your renders seem like they’re crashing maya, it’s because you skipped some of these steps. (Hanging renders are really just taking a long time because photons are floating in the ether of infinite space rather than being caught by the render volume. You can cancel hanging renders by selecting your main Maya window and hitting “ESC” key).

  1. Select “photonBoundary_pCube1”, right-click and hold to bring up the context-sensitive menu and assign new “Lambert” material

  2. Rename “lambert2” to “photonBoundary_lambert2”

  3. Navigate to shading group “lambert2SG” using the “Go to output connection” button and rename it to “photonBoundary_lambert2SG”

  4. Scroll down to “mental ray > Custom Shaders” and enable “Suppress all maya Shaders”



Transmat shaders help mental ray skip certain calculations in channels that should be ignored. And since we won’t be using certain calculations for our caustics effects, we’ll put transmat shaders into those slots:

  1. Put “transmat” shaders in both the “Material Shader” and “Shadow Shader” slots by clicking on the checkered boxes next to them
    , selecting “transmat” shader from the list, then navigating back to the “photonBoundary_lambert2SG” shading group by pressing the “Go to output connection” button

  2. Similarly, put “transmat_photon” shaders in both the “Photon Shader” slot, and the “Phot Volume Shader” slots, navigating back to the “photonBoundary_lambert2SG” shading group by pressing the “Go to output connection” button after each new shader is added

    

    Now it’s finally time to set up the volume shader. This is the shader that will be used to handle all photons inside the volume of the photon boundary cube.

      

    1. Put a “parti_volume” shader into the “Volume Shader” channel by clicking the “assign shader” button

    2. Rename “parti_volume1” to “photonBoundary_parti_volume1”, and leave all of the settings at their defaults (we will adjust them in future sections of this tutorial once the caustic effect can start being rendered)

    At this point, it would be a good idea to Navigate back to shading group “photonBoundary_lambert2SG”  one last time  by pressing the “Go to output connection” button , and make sure all the shader assignments match the image below.

     

    In order to avoid selecting this cube again accidentally while setting up the rest of the materials, it’s a good practice to put it on a referenced layer:

    1. Select “photonBoundary_pCube1” again

    2. Create a new layer from selection in the Layer Editor

    3. Rename the layer “Reference”

    4. Set its mode to “R” (Stands for “Reference”) so that any objects in this layer will be visible, but not selectable

    5. Environment materials

    Environment materials do not require any special setup (the material used for the environment in this tutorial is the default grey lambert1 material, which works fine).

    But similarly to the photon boundary cube, you don’t want to select this cube by accident either, so add it to the same reference layer:

    1. Select “environment_pCube1”

    2. Right-clicking on the “Reference” layer and choose “Add Selected Objects” from the context-sensitive menu