mental ray render pass utility shaders
 
 
 

When you use custom render passes, you can add the writeToColorBuffer, writeToDepthBuffer, writeToVectorBuffer, and writeToLabelBuffer shaders to your shading network to write data to a custom render pass node (that is, the framebuffer).

You can add each of these shaders through the Hypershade . Select Create mental ray Nodes and expand theMiscellaneous section. Select the appropriate shader depending on your input and framebuffer type. For example, writeToColorBuffer receives color as input and writes to framebuffers that are of type custom color.

The four shaders share attributes as follows:

Frame Buffer Options

Custom Color Pass

Select, from the drop-down list, the render pass that you want to write to. For the writeToColorBuffer node, all Custom Color passes are listed; for the writeToDepthBuffer node, all Custom Depth passes are listed, and so forth.

Write Operation

Select one of the following options: No Operation, Add, Multiply, and Replace.

Whenever one of the writeToColorBuffer, writeToDepthBuffer, writeToVectorBuffer, and writeToLabelBuffer shaders is being evaluated, Maya takes the color input attribute and saves it to the render pass. Multiple shaders may be writing to the same render pass. In this case, you can choose Add to add the new results to the existing contents in the render pass (other results could have been written from other shaders). Alternatively, if you choose Replace, the results and contents that are currently in the render pass are erased and replaced by the new results.

Scale Factor

Multiplication factor that is applied to the input, for example, color or alpha value. Useful for compositing.

Evaluation Trigger

Evaluation Mode

Pass Through Only

Use the shader as a passthrough. Information that is passed through is written to the framebuffer.

Pass Through Only should be used with Evaluation Pass Through (input and output), where the shader only writes its results to the render pass when the shader is inserted between two nodes, and only when the parent node calls one of the writeToColorBuffer, writeToDepthBuffer, writeToVectorBuffer, and writeToLabelBuffer shaders. This allows you to insert the shader in the shading network, and ensure that evaluation occurs in the right order.

Disabled

Shader is not executed. Evaluation of the shading network is blocked.

Always

Select this option to call the shader even though its output is dangling, For example, if the outEvaluationPassThrough output does not lead to the shading engine, or the pass is not visited during shading network evaluation, the shader is normally not evaluated. Selecting Always ensures that the shader is called and an output is written to the framebuffer.

When you use this mode, you cannot guarantee that evaluation occurs in a specific order. Shaders that use this mode should write to distinct render passes. Avoid having several shaders write to the same render pass.

Evaluation Pass Through

Color input that is used to trigger the evaluation. The result is copied to the outEvaluationPassThrough color output.

<input>

Value that is written to the framebuffer. Varies depending on the shader you selected. For example, for writeToColorBuffer, the Color and Alpha attributes appear. For writeToVectorBuffer, the Vector attribute appears.