mib_color_mix

 
 
 

Category: mental ray > Texture

Shader Family: Texture

Output: Color

This shader accepts a base color and up to 8 inputs (the exact number is determined by the num parameter), each of which consists of an input color, a weight scalar, and a mode. The inputs are evaluated in sequence, each operating on the result of the previous one (the first begins with the base color, which defaults to transparent black).

The following modes are supported:

Mode

Operation

Calculation

0

Blend

R = A . (1 - Ba) . w + B . w

1

Mix

R = A . (1 - w) + B . w

2

Add

R = A + B . w

3

Bounded Add

R = bound (A + B . w, 0, 1)

4

Multiply

R = A . B . w

5

Bounded Multiply

R = bound (A . B . w, 0, 1)

6

Replace Alpha

Rrgb = Argb; Ra = Ba

Where:

R is the next result

A is the previous result

B is the current color

w is the current weight

Subscripts r, g, b, and a are the red, green, blue, and alpha components.

Note that mode 6 does not ensure that the resulting alpha value is valid; that is, not less than red, green, or blue. mental ray corrects the alpha when storing the color in the frame buffer unless premultiplication is turned off.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

num

The number of valid inputs. The minimum is 1 and the maximum is 8.

mode_*

The compositing modes as described in the table above.

weight_*

The compositing weights w as described in the table above.

color_*

The composited colors B as described in the table above.

color_base

The base color.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License