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 mental ray in the Create bar and expand the Miscellaneous 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:
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.
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.
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.