Transparency Blend

Abstract: Transparency mental ray shader with multiple blending modes.

Description: This shader is the same as the mib_opacity/mib_transparency but support additional blending modes (e.g. add, multiply, difference, etc…)

Working Scenarios: This shader is useful for achieving custom blending effects the same way you do with other mixers but on objects’ transparencies.

User Usage: Use this shader to either alter an input color value (surface shader, image clip, texture), affect a specific color parameter (diffuse, transparency, specular), or both.

Developer Usage: In the supplied source code, you can add other blending modes that you would need.
The blending functions are laid out in an array, where each index corresponds to the value the SPDL sets. You can add more functions to this array, and index them in the shader's SPDL.
Note that I use some special checking on parameters values for performance optimizations.
Make sure the blending modes listing is the same in both the BlendFunc functions array and the SPDL.

Nature: Mental Ray Shader

Notes: Since the shader was developed using Visual Studio .NET you may need to copy the MSVCR71.DLL from the downloaded zip file in your windows\system32 directory to run the shader.

Applies To: XSI 3.5 on NT,Win2K,XP

Languages: C/C++