Indigo Technical Reference

Indigo Technical Reference.

The old technical reference is available in PDF form here.

Indigo Technical Reference

Command Line Parameter Reference

indigo [scenepathname]
Starts Indigo. If scenepathname is present, then it will attempt to load and start rendering that scene file.

-h hostname:port
Sets the hostname and port that a network slave indigo process will try and connect to, e.g.
indigo -n s -h masterhostname:7777

-halt X
Stops the Indigo process after X seconds. By default Indigo does not halt.

-haltspp X
Stops the Indigo process after X samples per pixel have been reached.

-igio pathname
Writes the Indigo Image (IGI) output to pathname instead of the usual generated pathname.

-image_save_period N
Sets the image save period to N seconds.

-n s
Start in network render slave mode.

-n m
Start in network render master mode.

-n wm
Start in network render working master mode. Working master mode is like master mode,
except rendering work is done on the master as well as the slaves.

-o pathname
Writes the render as a PNG to pathname instead of the usual generated pathname.

-p port
Instructs a network render master to listen on a particular port.

-r igi_path
Resume render using Indigo Image (.igi) found at igi_path.

-t numthreads
Runs the Indigo process with numthreads threads.

-v
Print out version information.

-texro out_path
Path to write the tone mapped EXR file to.

-uexro out_path
Path to write the un-tone mapped EXR file to.

-channels out_path
Path to write un-tone mapped channels EXR to.

--ptest
Runs performance test for the given scene.

--dumpmetadata png_path
Dump PNG meta data from file at png_path

--pack scene.igs out.pigs
Pack Indigo scene scene.igs to out.pigs

--unpack scene.pigs out
Unpack Indigo PIGS or PIGM to the directory out

--settings "settings_xml"
Appends the specified settings to the scene settings and overrides if already present

--tonemap scene.igs in.igi out.png
Tonemap in.igi using parameters in scene.igs, to out.png

--thread_priority [belownormal|normal]
Set the thread priority to belownormal or normal. Only has an effect on Windows.

--gpu_info
Displays information about system OpenCL devices

--merge_igi igilist out.igi
Merges the .igi files listed in igilist (one per line) into out.igi

--clear_cache
Deletes contents of cache directory

--hardwareid
Returns hardware ID of computer. (for licensing)

Indigo Technical Reference

Indigo Image File Format Specification

As of Indigo 4.2

Background

String format:

uint32 len // num bytes in string. <= 1024
char string_bytes[len] // data

The string is a Unicode string with UTF-8 encoding.

Indigo Image (.IGI) specification

// IGI Header

uint32 MAGIC_NUMBER = 66613373
uint32 version // latest version is 9
double num_samples
int original_width
int original_height
int32 supersample_factor
double total_render_time_elapsed
uint32 last_rng_seed
string scene_path
string node_xml

// Followed by render channels:

uint32 version // current is 2
uint32 internal_width
uint32 internal_height
uint32 stride // number of float32s per pixel
uint32 region_data // 1 if region data is present, 0 otherwise.
uint32 num_channels

// For each channel:

// chan_type is one of:
// ChannelType_MainLayers = 0
// ChannelType_Alpha = 1
// ChannelType_NonBeauty = 2
// ChannelType_MatMasks = 3
// ChannelType_ObMasks = 4
// ChannelType_Beauty = 5
// ChannelType_Spectral = 6
uint32 chan_type

// channel_name is one of:
//
// ChannelType_MainLayers:
// as defined in scene file
//
// ChannelType_Alpha:
// "alpha"
//
// ChannelType_NonBeauty:
// "normals"
// "normals_pre_bump"
// "depth"
// "position"
// "material_id"
// "object_id"
// "direct_lighting"
//
// ChannelType_MatMasks: any string
//
// ChannelType_ObMasks: any string
//
// ChannelType_Beauty:
// "direct_lighting"
// "indirect_lighting"
// "specular_reflection_lighting"
// "refraction_lighting"
// "transmission_lighting"
// "emission_lighting"
// "participating_media_lighting"
// "sss_lighting"
//
// ChannelType_Spectral
// "spectral"
//
string channel_name
int32 offset // Offset in floats, counted over all enabled channels. -1 if the channel is not enabled/used. >= 0 if the channel is used.
int32 num_components // Number of float components in this channel. Will be either 1, 3 or 4.

// End for each channel

float image_data[internal_width * internal_height * stride] // image data, with render channels interleaved per-pixel.

Indigo Technical Reference

Indigo Mesh File Format Specification

This is the Indigo Mesh format, which has the extension .igmesh on disk.

See IndigoMesh.h in the SDK for code to read and write this structure.

Notes:
uint32 is an unsigned 32 bit integer.
Byte order is little endian (Intel byte order).
Struct a[9] means that 'a' is an array of 9 'Struct's.

Specification

uint32 MAGIC_NUMBER // = 5456751

uint32 FORMAT_VERSION // = 4

uint32 compression // = 1 if Zstandard compression is used, 0 otherwise.

uint32 data_filtering // = 1 if data is filtered before compression, 0 otherwise.

uint32 num_uv_mappings // Number of UV mappings (UV layers) for this mesh. >= 0

uint32 num_material_names
String used_material_names[num_material_names] // Only used for old <model> scene format, not used for new <model2> scene format where materials are specified in the model2 element. num_material_names may be set to zero.

String format on disk is:

uint32 len // num bytes in string. <= 1024
char string_bytes[len] // data

The string is a Unicode string with UTF-8 encoding.

uint32 num_vert_positions
Vec3f vert_positions[num_vert_positions] // An array of vertex positions. Each vertex position is a single precision, floating-point 3-vector.

uint32 num_vert_normals
Vec3f vert_normals[num_vert_normals] // An array of vertex shading normals. This array can be empty if vertex shading normals are not available. If it is not empty then num_vert_normals should be equal to num_vert_positions.

uint32 uv_layout // Should be either MESH_UV_LAYOUT_VERTEX_LAYER (0) or MESH_UV_LAYOUT_LAYER_VERTEX (1).
Vec2f uv_pairs[num_uv_mappings*n]

An array of UV coordinates. The number of pairs must be a multiple of num_uv_mappings.
This array can be laid out in two possible ways.

MESH_UV_LAYOUT_VERTEX_LAYER UV layout is as follows (in this example num uvs = n, num layers = 2):

uv_0 layer 0
uv_0 layer 1

uv_1 layer 0
uv_1 layer 1

uv_2 layer 0
uv_2 layer 1

...

uv_n layer 0
uv_n layer 1

MESH_UV_LAYOUT_LAYER_VERTEX UV layout is as follows (in this example num uvs = n, num layers = 2):

layer 0 uv_0
layer 0 uv_1
layer 0 uv_2
layer 0 uv_3
...
layer 0 uv_n

layer 1 uv_0
layer 1 uv_1
layer 1 uv_2
layer 1 uv_3
...
layer 1 uv_n

uint32 num_triangles
Triangle triangles[num_triangles]

Where a triangle is defined as:

struct Triangle
{
uint32 vertex_indices[3]; /// Stores indices into the mesh vertex position array.
uint32 uv_indices[3]; /// Stores indices into the mesh uv_pairs array.
uint32 tri_mat_index; /// An index into the materials used by this mesh.
};

uint32 num_quads
Quad quads[num_quads]

Where a quad is defined as:

struct Quad
{
uint32 vertex_indices[4]; /// Stores indices into the mesh vertex position array.
uint32 uv_indices[4]; /// Stores indices into the mesh uv_pairs array.
uint32 mat_index; /// An index into the materials used by this mesh.
};

Indigo Technical Reference

Indigo Scene File Format Specification

Indigo Technical Reference > Indigo Scene File Format Specification

Scatter

density

Density of scattered objects. Type: real number. Units of objects per m^2.

seed

Random number generator seed. Type: positive integer. Default value 1.

view_culling

If true, remove instances not in direct camera view. Type: boolean. Default value false.

orient_normal

If true, align instances along the target object normal, instead of vertically. Type: boolean. Default value false.

scale_std_dev

Standard deviation of instance scale. Type: real number. Unit: dimensionless. Default value: 0.

height_std_dev

Standard deviation of instance height (z-scale). Type: real number. Unit: dimensionless. Default value: 0.

evenness

Controls evenness of scattering. 0 = very clumpy, 1 = very even. Type: real number. Default value: 0.

z_offset

Translate all instances by this value. Type: real number. Unit: meteres. Default value: 0.

shader

Object scattering can be controlled with shaders, as in the following example:

<scatter>
    <name>the scatter</name>
    <prototype_object_uid>4000</prototype_object_uid>

    <shader>
      <shader>
        <![CDATA[				
def evalScale(int index) float :
  pow(normalOS().z, 5.0)
				
def evalCreate(int index, vec3 p) bool :
  normalOS().z > 0.8
        ]]>
      </shader>
    </shader>

    <density>2</density>
    <evenness>1</evenness>
    <target_object_uid>2000</target_object_uid>
  </scatter>

evalScale determines the scaling of the object instance, and evalCreate determines if the object is created or not.

Indigo Technical Reference > Indigo Scene File Format Specification

renderer_settings

width

Sets the width (horizontal resolution) of the output image.
type: integer
restrictions: must be > 0
units: pixels
default value: 600

height

Sets the height (vertical resolution) of the output image.
type: integer
restrictions: must be > 0
units: pixels
default value: 450

metropolis

Enables or disables Metropolis-Hastings sampling
type: boolean
default value: true

large_mutation_prob

Probability of selecting a large mutation type. Only used if metropolis is true.
type: scalar real
restrictions: must in range [0, 1]
units: dimensionless
default value: 0.4

max_change

Radius of the perturbation mutation distribution.
type: scalar real
restrictions: must in range [0, 1]
units: dimensionless
default value: 0.01

max_depth

Maximum ray bounce depth.
type: integer
restrictions: must be > 0
units: number of bounces
default value: 10000

gpu_max_depth

Maximum ray bounce depth for GPU rendering.
type: integer
restrictions: must be > 0
units: number of bounces
default value: 8

max_num_consec_rejections

Maximum number of consecutive rejection of tentative new samples when Metropolis-Hastings transport is used. Note that any non-infinite number technically causes biased sampling.
type: integer
restrictions: must be > 0
units: number of rejections
default value: 1000

logging

If true, a log of the console output is written to log.txt
type: boolean
default value: true

bidirectional

If true, bidirectional path tracing is used to construct paths. Otherwise, backwards path tracing is used.
type: boolean
default value: true

save_png

If true, a tonemapped PNG image is saved in the renders directory.
type: boolean
default value: true

save_untonemapped_exr

If true, an untonemapped EXR image is saved in the renders directory.
type: boolean
default value: false

save_tonemapped_exr

If true, a tonemapped EXR image is saved in the renders directory.
type: boolean
default value: false

save_igi

If true, an untonemapped Indigo Image (.igi) file is saved in the renders directory.
type: boolean
default value: false

save_render_channels_exr

If true, light layers and render channels are saved to EXR(s) in the renders directory.
type: boolean
default value: false

image_save_period

The rendered image(s) will be saved to the renders directory every image_save_period seconds.
type: scalar real
restrictions: must be > 0
units: seconds
default value: 60

halt_time

If positive, indigo will halt after halt_time seconds.
type: scalar real
restrictions:
units: seconds
default value: -1

halt_samples_per_pixel

If positive, indigo will halt after halt_samples_per_pixel samples per pixel have been reached.
type: scalar real
restrictions:
units: samples / pixel
default value: -1

auto_choose_num_threads

If true, the number of render threads used is set based on the number of logical cores detected.
type: boolean
default value: true

num_threads

Number of render threads used. This setting is only used if auto_choose_num_threads is false.
type: integer
restrictions: must be > 0
units: number of threads
default value: 1

super_sample_factor

If this factor is greater than 1, then the image is rendered at a higher resolution internally, then downsampled using the downsize filter before the render is saved to disk. This can help to reduce aliasing around high contrast edges.
Note that higher factors require more memory (RAM).
type: integer
restrictions: must be > 0
units: dimensionless
default value: 2

watermark

If true, an 'Indigo Renderer' logo is drawn on the bottom right hand corner of the output render.
type: boolean
default value: false

info_overlay

If true, a line of text is drawn on the bottom of each render, containing some statistics about the current render process.
type: boolean
default value: false

verbose

If true, prints extra information during the scene build process to the render log widget and to the render log on disk.
type: boolean
default value: false

aperture_diffraction

If true, diffraction of light passing through the camera aperture is simulated.
type: boolean
default value: false

post_process_diffraction

If true, aperture_diffraction is simulated using a filter applied to the image buffer, instead of perturbation of rays. This technique is generally faster and less noisy, but slightly less accurate.
type: boolean
default value: true

write_aperture_preview

If true, saves a preview image of the camera aperture to disk when rendering starts.
type: boolean
default value: false

wait_for_slave_frames_on_stop

If true, waits for network slaves to upload the current image frame they are working on before stopping the rendering process.
type: boolean
default value: false

close_gui_on_halt

If true, closes the user interface after the halt condition is reached.
type: boolean
default value: false

save_images_on_close

If true, saves the current rendering to disk when the scene is closed.
type: boolean
default value: false

render_region

If this element is present, only a certain region of the usual image is rendered.
Only pixels (x, y) such that x1 <= x < x2 and y1 <= y < y2 are rendered.

render_region::x1

X Coordinate of top left pixel of rendered region.
type: integer
restrictions: must be >= 0
units: pixels

render_region::y1

Y Coordinate of top left pixel of rendered region.
type: integer
restrictions: must be >= 0
units: pixels

render_region::x2

X Coordinate of pixel immediately to the right of rendered region.
type: integer
restrictions: x1 < x2 <= width
units: pixels

render_region::y2

Y Coordinate of pixel immediately below rendered region.
type: integer
restrictions: y1 < y2 <= height
units: pixels

render_foreground_alpha

If this is true, renders an alpha channel as well as the usual RGB channels, where the foreground is alpha one, and the background (physical sky, env map, constant background, void background etc..) is alpha zero.
type: boolean
default value: false

shadow_pass

If true, renders a shadow pass. This captures the fraction of light unshadowed at each point on a shadow receiver material.
type: boolean
default value: false

splat_filter

Controls the filter used for splatting contributions to the image buffer.
Can be one of fastbox, radial, or mn_cubic.

splat_filter::fastbox

Default box filter, produces acceptable image quality and is very fast.

splat_filter::radial

A radially symmetric filter, slightly blurrier than fastbox and therefore should be used with super_sample_factor greater than one.

splat_filter::mn_cubic

Mitchell-Netravali cubic filter. Good all-round filter with little aliasing, but can cause black edges around high contrast edges (especially noticeable in HDR images).
Please refer to the paper 'Reconstruction Filters in Computer Graphics' by Mitchell and Netravali, 1988, for more information.

splat_filter::mn_cubic::blur

The 'B' parameter from the paper. Higher blur values cause more blurring of the image.
type: scalar real
restrictions: will give best results in range [0, 1]
units: dimensionless
default value: 0.6

splat_filter::mn_cubic::ring

The 'C' parameter from the paper. Higher ring values cause more 'ringing' (alternating bands of black and white around high contrast edges).
Note that Mitchell and Netravali recommend choosing B and C such that 2C + B = 1.
type: scalar real
restrictions: will give best results in range [0, 1]
units: dimensionless
default value: 0.2

downsize_filter

Controls the filter used for downsizing super-sampled images.
Only used when super_sample_factor is greater than one.
Can be one of mn_cubic (with the same parameters as the splat filter), gaussian (good for HDR images where you want to avoid black edges) or sharp.

downsize_filter::mn_cubic::radius

Defines the radius of the downsize filter function. Unlike the splat_filter, the downsize_filter can override the default mn_cubic filter radius of 2.0. This is only suggested for the B = 1, C = 0 case, where the radius can be set to a lower value such as 1.6 to prevent excessive blurring.
type: scalar real
restrictions: must be > 0.0.
units: dimensionless
default value: 2.0
element status: optional

vignetting

Toggles camera vignetting on/off.
type: boolean
default value: true

merging

If true, merges some objects together in order to improve the rendering speed.
type: boolean
default value: true

dithering

If true, adds some quasi-random noise to the render to avoid banding artifacts in the saved low-dynamic-range images.
type: boolean
default value: true

zero_alpha_outside_region

If true, when doing region rendering, parts of the image outside the render region have their alpha values set to zero. (e.g. they become invisible).
type: boolean
default value: false

gpu

Toggles GPU acceleration on/off.
type: boolean
default value: false

allow_high_quality_bvh

If true, a high-quality BVH build is done after GPU/Open-CL rendering begins, and is then subsequently used for GPU rendering. Requires more memory but results in faster rendering.
type: boolean
default value: true

clamp_contributions

If true, high contribution splats are clamped, resulting in fewer fireflies.
Introduces some bias to the rendering process.
type: boolean
default value: false

max_contribution

Contributions with components above this value will be clamped to this value, if clamp_contributions is enabled.
type: real
default value: 10.0

layer_setting

The layer_setting element allows setting some details about a specific light layer.

layer_setting::name

Sets the name of the light layer.
type: string

layer_setting::enabled

Enables or disabled the layer.
type: boolean
required: optional
default value: true

layer_setting::layer_scale

The layer_scale element controls scaling of the colour values in the light layer.

layer_setting::layer_scale::blackbody::temperature

Sets the colour temperature.
type: real

layer_setting::layer_scale::blackbody::gain

Sets a multiplier for the blackbody spectrum.
type: real

layer_setting::layer_scale::rgb::rgb

Sets the rgb colour
type: 3-vector

layer_setting::layer_scale::rgb::gain

Sets a multiplier for the RGB colour.
type: real

layer_setting::layer_scale::xyz::xyz

Sets the XYZ colour
type: 3-vector

layer_setting::layer_scale::xyz::gain

Sets a multiplier for the XYZ colour.
type: real

Render channels

These settings are all boolean, with default values false.
Please see the render channels section in the Indigo manual for more details on each channel.

normals_channel
normals_pre_bump_channel
position_channel
depth_channel
material_id_channel
object_id_channel
foreground_channel
material_masks
object_masks
direct_lighting_channel
indirect_lighting_channel
specular_reflection_lighting_channel
refraction_lighting_channel
transmission_lighting_channel
emission_lighting_channel
participating_media_lighting_channel
sss_lighting_channel

main_beauty_channel

This is the channel that is usually rendered, consisting of the main beauty render (possibly with multiple layers).
This channel can be disabled, for example if you just want to quickly render the normals channel.
default value: true

trace_through_trans_mats_for_channels

If true, rays are traced through transparent materials such as specular, when rendering albedo and normal passes.
If false, transparent materials are treated as opaque, so the albedo and normals will be those of the transparent materials themselves.
default value: true

spectral_output

If enabled, rendering is done to a spectral internal buffer, in addition to the usual XYZ colour-space buffer.
The spectral render channel will be available for viewing in the Indigo UI, and can be saved to disk.
type: boolean
default value: false

spectral_output_num_wavelength_buckets

Number of wavelength buckets used for the internal spectral render buffer.
type: integer
restrictions: >= 1
default value: 8

spectral_output_start_wavelength

This is the start wavelength (wavelength at the lower edge of the bucket) for the lowest-wavelength bucket, for the internal spectral render buffer. This value can be set to lower than 390 nm, although currently no lighting calculations for wavelengths lower than 390 nm will be computed.
type: real
unit: nm
restrictions: > 0
default value: 390

spectral_output_bucket_width

The width, in nm, of the wavelength buckets for the internal spectral render buffer.
type: real
unit: nm
restrictions: > 0
default value: 38.75

light_map_baking_ob_uid

If set to a valid UID (>= 0), Indigo will compute a lightmap for the object with the given UID.
type: int
default value: -1

generate_lightmap_uvs

If set to true, Indigo will generate a UV mapping for the mesh that it is computing lightmaps for, if any (see light_map_baking_ob_uid). The new UV mapping will be added to the mesh after the existing UV mappings.
For example, if the mesh has a single UV mapping with index 0, then a new UV mapping will be created with index 1.
The modified mesh with the additional UV mapping will be saved to disk at 'mesh_with_lightmap_uvs.igmesh' in the Indigo Renderer application data dir. (e.g. C:\Users\xx\AppData\Roaming\Indigo Renderer)

If generate_lightmap_uvs is false, then the UV mapping with the highest index in the mesh will be used as the lightmap UV mapping.
type: boolean
default value: false

capture_direct_sun_illum

This option only has an effect when computing a lightmap.
If set to false, direct illumination from the sun will not be captured in the light map. This is useful in the case that direct sun illumination will be rendered using some other technique at runtime, for example shadow mapping.
type: boolean
default value: true

Indigo Technical Reference

Indigo Shader Language Reference

The Indigo Shader Language (ISL) allows users of Indigo to write programs (known as shaders) that can control many aspects of Indigo, such as all material parameters. (colour, roughness, displacement etc..)

ISL is based on Winter, a high performance functional programming language.

See https://github.com/glaretechnologies/winter for Winter documentation.

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Debugging functions

print(real x) real
print(int x) int
print(bool x) bool
print(vec2 x) vec2
print(vec3 x) vec3
print(mat2x2 x) mat2x2
print(mat3x3 x) mat3x3

Prints the value of x to standard output, then returns it.

If there are multiple calls to print in a shader, the function calls are not guaranteed to execute in any particular order.

To view the standard output from Indigo, you will need to run the console version of Indigo - indigo_console. (indigo_console.exe on Windows etc..)

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Maths utility functions

pi() real

Returns pi.

mod(real x, real y) real
mod(int x, int y) int

Returns the remainder of x / y.

sin(real x) real

Returns sin(x).

asin(real x) real

Returns sin^-1(x).

cos(real x) real

Returns cos(x).

acos(real x) real

Returns cos^-1(x).

tan(real x) real

Returns tan(x).

atan(real x) real

Returns tan^-1(x).

atan2(real y, real x) real

Returns tan^-1(y/x), mapped into the range [-pi, pi]

abs(real x) real
abs(int x) int

Returns the absolute value of x.

exp(real x) real

Returns e^x.

pow(real x, real y) real

Returns x^y.

sqrt(real x) real

Returns x^1/2.

log(real x) real

Returns the natural logarithm of x, ln(x).

floor(real x) real

Returns the largest integer y, such that x >= y.

ceil(real x) real

Returns the smallest integer y, such that x <= y.

fract(real x) real

Returns x – floor(x).

floorToInt(real x) int

Returns floor(x) converted to an integer.

ceilToInt(real x) int

Returns ceil(x) converted to an integer.

real(int x) real

Converts x to type real.

min(int x, int y) int
min(real x, real y) real
min(vec2 x, vec2 y) vec2
min(vec3 x, vec3 y) vec3

If x < y, returns x, otherwise returns y.
In the case of vec2 or vec3 arguments, the comparison is done component-wise.

max(int x, int y) int
max(real x, real y) real
max(vec2 x, vec2 y) vec2
max(vec3 x, vec3 y) vec3

If x > y, returns x, otherwise returns y.
In the case of vec2 or vec3 arguments, the comparision is done component-wise.

lerp(real x, real y, real t) real
lerp(vec2 x, vec2 y, real t) vec2
lerp(vec3 x, vec3 y, real t) vec3

Returns x * (1 – t) + y * t

clamp(int x, int minval, int maxval) int
clamp(real x, real minval, real maxval) real
clamp(vec2 x, vec2 minval, vec2 maxval) vec2.
clamp(vec3 x, vec3 minval, vec3 maxval) vec3

Returns max(minval, min(maxval, x)).
In the case of vec2 or vec3 arguments, the clamping is done component-wise.
Undefined if minval > maxval.

step(real step_x, real x) real

Returns 1 if x >= step_x, 0 otherwise.

smoothstep(real a, real b, real x) real

Returns 0 if x <= a, 1 if x >= b, and interpolates smoothly between 0 and 1 as x ranges from a to b.

smootherstep(real a, real b, real x) real

Like smoothstep but smoother.

pulse(real a, real b, real x) real

0 if x < a or x > b, 1 otherwise.

smoothPulse(real a, real b, real c, real d, real x)

0 when x < a, smoothly interpolates up to 1 when x is between a and b, 1 between b and c, smoothly interpolates down to 0 when x is between c and d. 0 when x > d.

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Matrix functions

Matrix constructors

mat2x2(real e11, real e12, real e21, real e22) mat2x2

Returns the 2 x 2 matrix
e11 e12
e21 e22

mat3x3(real e11, real e12, real e13, real e21, real e22, real e23, real e31, real e32, real e33) mat3x3
Returns the 3 x 3 matrix

e11 e12 e13
e21 e22 e23
e31 e32 e33

Matrix operations

mul(mat2x2 A, mat2x2 B) mat2x2

Returns the 2 x 2 matrix AB.

mul(mat3x3 A, mat3x3 B) mat3x3

Returns the 3 x 3 matrix AB.

mul(mat2x2 A, vec2 b) vec2

Returns the 2-vector (2 x 1 matrix) Ab.

mul(mat3x3 A, vec3 b) vec3

Returns the 3-vector (3 x 1 matrix) Ab.

transpose(mat2x2 A) mat2x2
transpose(mat3x3 A) mat3x3

Returns the transpose of A.

inverse(mat2x2 A) mat2x2
inverse(mat3x3 A) mat3x3

Returns the inverse of A. Undefined if A is not invertible.

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Miscellaneous functions

normalWS() vec3

Returns the shading normal for the current surface point in world space.

posOS() vec3

Returns the current surface point in object space coordinates.

minCosTheta() real

Returns the minimum of the cosines of the zenith angles of the incident and exitant vectors of a ray scattering off a surface.

maxCosTheta() real

Returns the maximum of the cosines of the zenith angles of the incident and exitant vectors of a ray scattering off a surface.

intrinsicCoords() vec2

Returns the intrinsic coordinates for the intersected triangle.

objectId() int

Returns a unique integer identifier for the currently hit object.

meanCurvature() real

Return the mean curvature at the current point.


Curvature shader controlling the material colour. Red = negative mean curvature, green/blue = positive mean curvature.

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Procedural noise functions

Basic noise

The basic noise function is Perlin noise, which is a pseudo-random noise function.

This is an example of Perlin noise used as a displacement value:

noise(real x) real

Returns single-valued (scalar) Perlin noise evaluated at x. Values returned lie in the range from -1 to 1.

noise(vec2 x) real

Returns single-valued Perlin noise evaluated at x.

noise(vec3 x) real

Returns single-valued Perlin noise evaluated at x.

noise3Valued(vec2 pos) vec3

Returns 3-valued noise (each component is a decorrelated noise value) evaluated at 2d-coordinates.

noise3Valued(vec3 pos) vec3

Returns 3-valued noise (each component is a decorrelated noise value) evaluated at 3d-coordinates.


An example of 3-valued noise.

noise2D4Valued(real x, real y)

Returns 4-valued noise (each component is a decorrelated noise value) evaluated at 2d-coordinates.

noise4Valued(real x, real y, real z)

Returns 4-valued noise (each component is a decorrelated noise value) evaluated at 3d-coordinates.

Basic Fractional Brownian Motion noise

This type of noise is made by adding together a number of different frequences of Perlin noise together.


FBM, 1 Octave of noise.


FBM, 2 Octaves of noise.


FBM, 3 Octaves of noise.


FBM, 10 Octaves of noise.

fbm(real x, int oc) real

Returns oc octaves of 1-D Fractional Brownian Motion noise evaluated at x.

fbm(vec2 x, int oc) real

Returns oc octaves of 2-D Fractional Brownian Motion noise evaluated at x.

fbm(vec3 x, int oc) real

Returns oc octaves of 3-D Fractional Brownian Motion noise evaluated at x.

Grid noise

gridNoise(real x) real
gridNoise(vec2 x) real
gridNoise(vec3 x) real

Takes the floor of the coordinates passed in, and then returns a quasi-random value between 0 and 1 for those integer coordinates.


Grid noise.

Voronoi noise

voronoi(vec2 p, real irregularity) vec2

Returns the coordinates of the nearest Voronoi site.
The irregularity argument controls the 'randomness' of the site positions. It should lie in the range [0, 1].
Irregularity of zero corresponds to a regular grid of site positions.
Irregularity of one corresponds to the maximum 'randomness' of cell positions within the grid, so that the grid is not visible.


A shader based on Voronoi noise. The white value of the shader is based on the distance in UV space from the shaded point to the nearest Voronoi site. Irregularity = 0.2.


A shader based on Voronoi noise. The white value of the shader is based on the distance in UV space from the shaded point to the nearest Voronoi site. Irregularity = 0.8.

voronoi3d(vec3 p, real irregularity) vec3

Similar to above, but takes a 3d vector and returns the nearest Voronoi site in 3d.

Advanced Fractional Brownian Motion Noise

fbm(int basis_type, vec3 x, real H, real lacunarity, real num_octaves) real

This fbm function is a more general fbm that takes more parameters.

basis_type selects from a number of basis noise functions:
0: Perlin basis
1: Ridged basis
2: Voronoi basis

x is a 3-vector at which the noise is evaluated.

H controls the fractal dimension: a larger value causes faster attenuation of higher frequencies.
A good default value is 1.

Lacunarity determines the gap in frequencies between different 'octaves' of noise.
A larger lacunarity means each subsequence octave will have higher frequency.
A good default value is 2.

Octaves determines the number of octaves of noise that are added together. If the value has a fractional component, the last octave is attenuated by the fractional part then added.

Basis Types


Perlin basis, 1 octave


Ridged basis, 1 octave


Voronoi basis, 1 octave

Effect of number of octaves


Perlin basis, 1 octave


Perlin basis, 2 octaves


Perlin basis, 3 octaves


Perlin basis, 10 octaves


Ridged basis, 1 octave


Ridged basis, 10 octaves


Voronoi basis, 1 octave


Voronoi basis, 10 octaves

Effect of fractal dimension (H)


Ridged basis, H=1


Ridged basis, H=1.5


Ridged basis, H=2

Effect of Lacunarity


Ridged basis, lacunarity = 3


Ridged basis, lacunarity = 4


Ridged basis, lacunarity = 6

You can download the example Indigo scene used in the images above here.

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Texture sampling functions

getTexCoords(int texcoord_set_index) vec2

Gets the i-th texture coordinates at the shading point, where i = texcoord_set_index.

sample2DTextureVec3(int texture_index, vec2 st) vec3

Samples the i-th texture defined in the current material, where i = texture_index is a 0-based index, at the normalised coordinates (s, t). Returns a (R, G, B) triplet, where each component will be in the range [0, 1].

Indigo Technical Reference > Indigo Shader Language Reference

Built-in functions – Vector functions

Vector constructors

vec2(real x, real y) vec2

Returns the 2-vector (x, y).

vec2(real x) vec2

Returns the 2-vector (x, x).

vec3(real x, real y, real z) vec3

Returns the 3-vector (x, y, z).

vec3(real x) vec3

Returns the 3-vector (x, x, x).

Vector functions

dot(vec2 a, vec2 b) real
dot(vec3 a, vec3 b) real

Returns the dot product of a and b.

cross(vec3 a, vec3 b) vec3

Returns the cross product of a and b.

length(vec2 a) real
length(vec3 a) real

Returns the length of a, ||a||.

normalise(vec3 a) vec3

Returns a / ||a||

Indigo Technical Reference

Spectral Input and Output

Indigo supports spectral environment maps - environment maps that are not just RGB, but have information organised into wavelength buckets.

Spectral environment maps are EXR files that follow a particular channel naming scheme.

For example:

wavelength400
wavelength430_25
wavelength460_50
wavelength490_75

etc..

The spectral EXR file must have only channels with channel names prefixed with 'wavelength'.
Following the 'wavelength' prefix is the wavelength of the lower edge of the bucket, in nm.
The underscore character is used as a decimal seperator, for example 3.14 becomes 3_14.
(The full stop character could not be used as it has special meaning as a layer separator character in EXR channel naming convention)

Bucket start wavelengths should be equally spaced. If the wavelengths are not equally spaced, rendering results will be incorrect.

The unit of the values in the spectral EXR file is considered to be spectral radiance (Wsr^-1m^-3), although this will only be the case if no emission scaling is applied to the values.

Spectral output from Indigo

Indigo can compute lighting information with a spectral internal rendering buffer, and save a spectral image based on that buffer.

To use a spectral internal buffer, you need to enable the spectral_output render setting. (See renderersettings for more information)

The other relevant render settings are spectral_output_num_wavelength_buckets, spectral_output_start_wavelength, spectral_output_bucket_width.

Saving a spectral EXR from Indigo

Spectral output can be saved from Indigo to an EXR file.
This can be done in the Indigo user interface with the

Render > Save Layers and Channels

menu command.
Depending on the setting 'combine into single file' in the Layers and Channels section, in the Image Saving tab in the Indigo options dialog, this menu command will either save the spectral data into its own EXR file, or into an EXR file shared with the other render channels.

If it is saved into its own EXR file, the channel names will be as for the environment map spectral EXRs - e.g. wavelength430_25 etc..

If the EXR file is shared, the spectral channels will be prefixed with the 'spectral' layer name, resulting in channel names like

spectral.wavelength430_25

Wavelength range computed by Indigo

Currently Indigo computes rendering results only in the range 390 nm to 700 nm, which roughly corresponds to the visible spectrum. (The lower bound was reduced from 400 nm to 390 nm in Indigo v4.4.7).

EXR input files may cover a wider range of wavelengths, but wavelengths outside the 390 nm to 700 nm range will be ignored. Likewise spectral output files may be configured to cover a wider range of wavelengths, but zero values will be written for buckets out of the 390 nm to 700 nm range.