Share

Color - Arnold for Houdini

Below is a list of color correction nodes available in HtoA.

Color Correct

The color_correct node allows you to adjust the gamma, hue, saturation, contrast, and exposure of an image. Alters the input color with the following operator, applied in the same order as the parameters.

Color Convert

The color_convert node allows you to convert input color from one of the following color spaces to another:

  • RGB: Linear RGB
  • HSV: Hue, Saturation, Value

Color Jitter

The color_jitter shader enables you to alter the input color by applying a random color variation. For each of the following parameters, you can specify the range of hue, saturation, and gain (HSV) for the random colors. The seed is used to get a different random variation.

Mix RGBA

The mix_RGBA is used to blend or add two colors or textures. It returns a linear interpolation of input1 and input2 according to the mix_weight attribute. A mix_weight value of 0 outputs input 1 , a value of 1 outputs input2, and a value of 0.5 mixes evenly between input1 and input2.

Mix Shader

The mix_shader shader is used to blend or add two shaders (including light AOVs). It returns a linear interpolation of shader1 and shader2 according to the mix_weight attribute. A mix_weight value of 0 outputs shader 1, a value of 1 outputs shader2, and a value of 0.5 mixes evenly between shader1 and shader2.

Shuffle

Combines RGB and alpha inputs to output an RGBA by default. Additionally, there are parameters to shuffle the channels, to choose which of the R, G, B, A input channels go to which R, G, B, A output channels, and parameters to negate the colors. This node could be useful, for example, with normal or vector displacement maps that have a different channel convention.

Data Types

Arnold Data Type colors on Houdini Nodes

When connecting the same data types together in a shading network, the line will appear solid to indicate there is no conversion, as in the 'string' connection below. If the data types are different, like in RGBA > Vector or RGB > RGBA below, then the line appears as a broken line.

Solid line (between user_data_string and image) and a broken line between standard_surface and OUT_material)

Shader output components are displayed on the VOP node, allowing component connections without the need for a conversion shader.

However, the following shaders allow more complicated conversions between data types:

Float To Int

Converts a float into an integer value.

  • Round: Rounds the input to the closest integer.
  • Trunc: If the input is negative, this returns ceil(x), otherwise it returns floor(x).
  • Floor: Returns the largest integer less than or equal to the input
  • Ceil:  Returns the smallest integer greater than or equal to the input.

Float To Matrix

Compose a 4x4 matrix from 16 input components.

Float To RGB

Combine 3 floats into an RGB.

Float To RGBA

Combine 4 floats into an RGBA.

Matrix To Float

Extracts a component at the given column and row.

Int To Float

Converts an integer into a float value.

RGB To Float

Converts an RGB input to a float using the following modes

  • min: Minimum component.
  • max: Maximum component.
  • average: Average of the RGB components.
  • sum: Sum of the RGB components.
  • luminance: Perceptual grayscale value as defined by Rec.709.

RGB To RGBA

Combine RGB and alpha inputs into an RGBA.

RGB To Vector

  • raw: Passes the input through, does nothing.
  • canonical: Converts the input from [0, 1] range to [-1, 1].

RGBA To Float

Combine an RGBA input to a float using the following modes

  • min: Minimum component.
  • max: Maximum component.
  • average: Average of the RGB components.
  • sum: Sum of the RGB components.
  • luminance: Perceptual grayscale value as defined by Rec.709.

Vector To RGB

  • raw: Passes the input through, does nothing.
  • normalized: Normalizes the vector before converting the input from [0, 1] range to [-1, 1].
  • canonical: Converts the input from [0, 1] range to [-1, 1].

Arnold Data Type Conversions

The following table shows how data types are converted within Arnold itself.

Key:

(empty) conversion is disallowed/ignored
copy copy (no need to convert)
expand all components set to the same source value
shallow copy for pointer types (pointer, node, array, matrix), copy the pointer, not the actual value
boolean cast zero means false, non-zero means true, and vice-versa
upcast smaller integer type just gets stuffed into a larger integer type
downcast larger integer type gets truncated into a smaller integer type
average the average of the components are taken
TARGET
SOURCE enum boolean byte int uint float RGB RGBA vector point point2
enum copy
boolean copy boolean cast boolean cast boolean cast
byte boolean cast copy upcast upcast
int boolean cast downcast copy copy
uint boolean cast downcast copy copy
float copy r = flt g = flt b = flt r = flt g = flt b = flt a = 1 x = flt y = flt z = flt x = flt y = flt z = flt x = flt y = flt
RGB average(rgb) copy r = r g = g b = b a = 1 x = r y = g z = b x = r y = g z = b x = r y = g
RGBA average(rgb) r = r g = g b = b copy x = r y = g z = b x = r y = g z = b x = r y = g
vector vector.x r = x g = y b = z r = x g = y b = z a = 1 copy x = x y = y z = z
point pnt.x r = x g = y b = z r = x g = y b = z a = 1 x = x y = y z = z copy
point2 pnt2.x r = x g = y b = 0 r = x g = y b = 0 a = 1 x = x y = y z = 0 x = x y = y z = 0 copy
string
node
pointer
array
matrix
TARGET
SOURCE string node pointer array matrix
enum
boolean
byte
int
uint
float
RGB
RGBA
vector
point
point2
string copy
node shallow copy
pointer shallow copy
array shallow copy
matrix shallow copy

A few notes:

  • The node type (AI_TYPE_NODE) is currently resolved at scene creation time, and node-to-node shader connections are not formally allowed since they internally are turned into a connection based on the output type of the shader node. However, whenever one wants to pass a node along, they can pass it as a generic pointer type instead of using other mechanisms such as shader message passing. The vast majority of the time, if you are using pointer passing inside of your shaders, you should rethink your design.
  • No automatic conversions exist between integer types and floating-point types.
  • No automatic conversions exist between enumerations and any other type.

Was this information helpful?