GLSL MAT

From Derivative
Jump to: navigation, search


Summary

The GLSL MAT allows you to write or import custom materials into TouchDesigner. When there are compile errors in a GLSL shader, a blue/red checkerboard error shader will be displayed.

For more information on writing a shader, see Write a GLSL Material, and the GLSL Category.

PythonIcon.pngglslMAT_Class


Parameters - Load Page

GLSL Version glslversion - - Pick what version of GLSL to compile the shader with.

  • 1.20 glsl120 -
  • 3.30 glsl330 -
  • 4.00 glsl400 -
  • 4.10 glsl410 -
  • 4.20 glsl420 -
  • 4.30 glsl430 -
  • 4.40 glsl440 -
  • 4.50 glsl450 -

Vertex Shader vdat - Path to the DAT that holds the vertex shader code.

Pixel Shader pdat - Path to the DAT that holds the pixel shader code.

Load Uniform Names loaduniformnames - This will read all the declared (and used) uniforms in the compiled GLSL shader, and fill in the various name fields for the uniform parameters.

Clear Uniform Names clearuniformnames - This will clear all of the name fields for the uniform parameters.

Geometry Shader gdat - Path to the DAT that holds the geometry shader code.

Input Primitive Type inprim - - The type of geometry that will be inputed into the Geometry Shader.

  • Points points -
  • Lines lines -
  • Triangles triangles -

Output Primitive Type outprim - - The type of geometry that the Geometry Shader will output.

  • Points points -
  • Line Strip linestrip -
  • Triangle Strip tristrip -

Num Output Vertices numout - The maximum number of vertices the Geometry Shader will output.

Two Sided Coloring twocolor - Enables support for two-sided coloring. When this is enabled the Vertex and/or Geometry shader can write to gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor and gl_BackSecondaryColor and the correct color will be placed into gl_Color and gl_SecondaryColor in the Pixel shader depending on if the primitive's front face or back face is facing the camera. When this is disabled the values placed into gl_FrontColor and gl_FrontSecondaryColor are passed to gl_Color and gl_SecondaryColor regardless of which side of the primitive is facing the camera.

Inherit Uniforms/Samplers from inherit - This Material will inherit all of the Textures and Uniforms from the GLSL Material referenced in this parameter.

Lighting Space lightingspace - - Allows lighting space switch from the current default World Space to legacy Camera Space which was used for TouchDesigner 088.

  • World Space worldspace -
  • Camera Space (Legacy 088 shaders) cameraspace -


Parameters - Samplers 1 Page

Sampler Name sampler0 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top0 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top0extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top0extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top0extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top0filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top0anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler1 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top1 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top1extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top1extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top1extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top1filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top1anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler2 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top2 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top2extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top2extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top2extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top2filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top2anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler3 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top3 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top3extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top3extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top3extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top3filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top3anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler4 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top4 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top4extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top4extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top4extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top4filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top4anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -


Parameters - Samplers 2 Page

Sampler Name sampler5 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top5 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top5extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top5extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top5extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top5filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top5anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler6 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top6 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top6extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top6extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top6extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top6filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top6anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler7 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top7 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top7extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top7extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top7extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top7filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top7anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler8 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top8 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top8extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top8extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top8extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top8filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top8anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Sampler Name sampler9 - This is the sampler name that the GLSL program will use to sample from this TOP. The samplers need to be declared at the same dimentions as the TOP (sampler2D for a 2D TOP, sampler3D for 3D TOP).

TOP top9 - This is the TOP that will be referenced by the above sampler name above it.

Exposed by the + Button, texture sampling parameters:

Refer to the Texture Sampling Parameters article for more information on the parameters exposed by pressing the + button. The parameter prefix for each of the parameters is top0 up to top9.

Texture Sampling Parameters

Extend U top9extendu - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V top9extendv - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W top9extendw - -

  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter top9filter - -

  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -

Anisotropic Filter top9anisotropy - -

  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -


Parameters - Vectors 1 Page

Uniform Name uniname0 - The name of the uniform.

Value value0- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value0x -


Y value0y -


Z value0z -


W value0w -

Uniform Name uniname1 - The name of the uniform.

Value value1- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value1x -


Y value1y -


Z value1z -


W value1w -

Uniform Name uniname2 - The name of the uniform.

Value value2- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value2x -


Y value2y -


Z value2z -


W value2w -

Uniform Name uniname3 - The name of the uniform.

Value value3- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value3x -


Y value3y -


Z value3z -


W value3w -

Uniform Name uniname4 - The name of the uniform.

Value value4- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value4x -


Y value4y -


Z value4z -


W value4w -

Uniform Name uniname5 - The name of the uniform.

Value value5- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value5x -


Y value5y -


Z value5z -


W value5w -

Uniform Name uniname6 - The name of the uniform.

Value value6- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value6x -


Y value6y -


Z value6z -


W value6w -

Uniform Name uniname7 - The name of the uniform.

Value value7- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value7x -


Y value7y -


Z value7z -


W value7w -

Uniform Name uniname8 - The name of the uniform.

Value value8- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value8x -


Y value8y -


Z value8z -


W value8w -

Uniform Name uniname9 - The name of the uniform.

Value value9- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value9x -


Y value9y -


Z value9z -


W value9w -

Uniform Name uniname10 - The name of the uniform.

Value value10- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value10x -


Y value10y -


Z value10z -


W value10w -


Parameters - Vectors 2 Page

Uniform Name uniname11 - The name of the uniform.

Value value11- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value11x -


Y value11y -


Z value11z -


W value11w -

Uniform Name uniname12 - The name of the uniform.

Value value12- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value12x -


Y value12y -


Z value12z -


W value12w -

Uniform Name uniname13 - The name of the uniform.

Value value13- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value13x -


Y value13y -


Z value13z -


W value13w -

Uniform Name uniname14 - The name of the uniform.

Value value14- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value14x -


Y value14y -


Z value14z -


W value14w -

Uniform Name uniname15 - The name of the uniform.

Value value15- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value15x -


Y value15y -


Z value15z -


W value15w -

Uniform Name uniname16 - The name of the uniform.

Value value16- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value16x -


Y value16y -


Z value16z -


W value16w -

Uniform Name uniname17 - The name of the uniform.

Value value17- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value17x -


Y value17y -


Z value17z -


W value17w -

Uniform Name uniname18 - The name of the uniform.

Value value18- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value18x -


Y value18y -


Z value18z -


W value18w -

Uniform Name uniname19 - The name of the uniform.

Value value19- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value19x -


Y value19y -


Z value19z -


W value19w -

Uniform Name uniname20 - The name of the uniform.

Value value20- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value20x -


Y value20y -


Z value20z -


W value20w -

Uniform Name uniname21 - The name of the uniform.

Value value21- - The value to assign to the uniform. If the uniform is a float the first entry of the four is used, if the uniform is a vec2 the first two entries are used, etc.

X value21x -


Y value21y -


Z value21z -


W value21w -


Parameters - Arrays 1 Page

CHOP Uniforms allow you to send CHOP channel data into a GLSL shader as an array. Depending on the array type used, the number of values you can send into the shader may be limited. If you are using Uniform Arrays, you can use the Built-In variable $SYS_GFX_GLSL_MAX_UNIFORMS to get an idea of how many values you can pass to the shader. Current GPUs are vec4 based for uniform arrays, so the maximum array size is $SYS_GFX_GLSL_MAX_UNIFORMS / 4. Other uniforms will take away from this maximum. If you are using Texture Buffers the maximum array size is far bigger, $SYS_GFX_MAX_TEXTURE_BUFFER_SIZE will tell you the max for this. The max for texture buffer is per texture buffer, and having multiple texture buffers does not take away from the max for each array.

Uniform Name chopuniname0 - The name of the uniform.

Type chopunitype0 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop0 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype0 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope0 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname1 - The name of the uniform.

Type chopunitype1 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop1 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype1 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope1 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname2 - The name of the uniform.

Type chopunitype2 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop2 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype2 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope2 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname3 - The name of the uniform.

Type chopunitype3 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop3 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype3 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope3 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname4 - The name of the uniform.

Type chopunitype4 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop4 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype4 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope4 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).


Parameters - Arrays 2 Page

CHOP Uniforms allow you to send CHOP channel data into a GLSL shader as an array. Depending on the array type used, the number of values you can send into the shader may be limited. If you are using Uniform Arrays, you can use the Built-In variable $SYS_GFX_GLSL_MAX_UNIFORMS to get an idea of how many values you can pass to the shader. Current GPUs are vec4 based for uniform arrays, so the maximum array size is $SYS_GFX_GLSL_MAX_UNIFORMS / 4. Other uniforms will take away from this maximum. If you are using Texture Buffers the maximum array size is far bigger, $SYS_GFX_MAX_TEXTURE_BUFFER_SIZE will tell you the max for this. The max for texture buffer is per texture buffer, and having multiple texture buffers does not take away from the max for each array.

Uniform Name chopuniname5 - The name of the uniform.

Type chopunitype5 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop5 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype5 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope5 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname6 - The name of the uniform.

Type chopunitype6 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop6 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype6 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope6 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname7 - The name of the uniform.

Type chopunitype7 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop7 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype7 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope7 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname8 - The name of the uniform.

Type chopunitype8 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop8 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype8 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope8 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).

Uniform Name chopuniname9 - The name of the uniform.

Type chopunitype9 - - The type of the uniform. You can send up to 4 channels into the GLSL shader in a single uniform. For a CHOP with a single channel declare your uniform as a float, for one with two channels declare your uniform as a vec2, etc. The data is interleaved in the uniform. I.e., the .x component is the 1st channel, .y is the 2nd channel, etc.

CHOP chop9 - The CHOP whose channels will be sent to the GLSL shader.

Array Type choparraytype9 - - GPUs can send array data into a GLSL shader using Uniform Arrays or Texture Buffers. A Uniform Array uses very limited memory to store its data, and can be access like any other regular uniform value (but in an array). Texture Buffers use texture memory and texture fetches to access the data, which allows them to store many more values.

In both cases the index is the 0-based index (an integer) into the array/buffer that you want to get a value for.

  • Uniform Array uniformarray - A Uniform Array is declared and used like this:
 // Array type is vec3, and it takes up to 20 values from the CHOP				
 uniform vec3 arrayName[20];				
 // Grab the value at index 10				
 vec3 aValue = arrayName[10];		
  • Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.				
 uniform samplerBuffer arrayName;				
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz				
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

Channel Scope chanscope9 - You can select which channels from the CHOP will be used to fill the array. Up to the first 4 channels scoped will be used (depending on the type of the uniform array).


Parameters - Matrices Page

Relative Xforms are matrices that will transform points and vectors from one space to another space.

Uniform Name unimatrixname0 - The name of the uniform. The uniform should be declared as a mat4.

Xform from fromcomp0 - Transform from this COMPs world transform.

To tocomp0 - Transform to this COMPs world transform.

Uniform Name unimatrixname1 - The name of the uniform. The uniform should be declared as a mat4.

Xform from fromcomp1 - Transform from this COMPs world transform.

To tocomp1 - Transform to this COMPs world transform.

Uniform Name unimatrixname2 - The name of the uniform. The uniform should be declared as a mat4.

Xform from fromcomp2 - Transform from this COMPs world transform.

To tocomp2 - Transform to this COMPs world transform.

Uniform Name unimatrixname3 - The name of the uniform. The uniform should be declared as a mat4.

Xform from fromcomp3 - Transform from this COMPs world transform.

To tocomp3 - Transform to this COMPs world transform.

Uniform Name unimatrixname4 - The name of the uniform. The uniform should be declared as a mat4.

Xform from fromcomp4 - Transform from this COMPs world transform.

To tocomp4 - Transform to this COMPs world transform.


Parameters - Deform Page

Refer to the Deform Article for more information on doing deforms in TouchDesigner.

Deform dodeform - Enables deforms on this material.

Get Bone Data: deformdata - - Specifies where the deform bone data will be obtained.

  • From a SOP sop -
  • From another MAT mat -
  • From a DeformIn MAT deformin -

SOP with Capture Data targetsop - Specifies the SOP that contains the deform capture attributes.

pCaptPath Attrib pcaptpath - Specifies the name of the pCaptPath attribute to use. When your geometry has been put through a Bone Group SOP, the attributes will be split into names like pCaptPath0, pCaptPath1. You can only render 1 bone group at a time, so this should match the group you are rendering with this material.

pCaptData Attrib pcaptdata - Much like pCaptPath Attrib.

Skeleton Root Path skelrootpath - Specifies the path to the COMP where the root of the skeleton is located.

MAT mat - When obtaining deform data from a MAT or a Deform In MAT, this is where that MAT is specified.



Parameters - Common Page

Blending

Blending is summing the color value of the pixel being drawn and the pixel currently present in the Color-Buffer. Blending is typically used to simulate Transparency. The blending equation is: Final Pixel Value = (Source Blend * Source Color) + (Dest Blend * Destination Color)


Blending(Transparency) blending - This toggle enables and disables blending. However see the wiki article Transparency.

Source Color * srcblend - - This value is multiplied by the color value of the pixel that is being written to the Color-Buffer (also know as the Source Color).

  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Source Alpha Saturate sas -
  • One one -

Destination Color * destblend - - This value is multiplied by the color value of the pixel currently in the Color-Buffer (also known as the Destination Color).

  • One one -
  • Src Color scol -
  • One Minus Src Color omscol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Zero zero -

Separate Alpha Function separatealphafunc - This toggle enables and disables separate blending options for the alpha values.

Source Alpha * srcblenda - - This value is multiplied by the alpha value of the pixel that is being written to the Color-Buffer (also know as the Source Alpha).

  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Source Alpha Saturate sas -
  • One one -

Destination Alpha * destblenda - - This value is multiplied by the alpha value of the pixel currently in the Color-Buffer (also known as the Destination Alpha).

  • One one -
  • Src Color scol -
  • One Minus Src Color omscol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Zero zero -


Depth Test

Depth-Testing is comparing the depth value of the pixel being drawn with the pixel currently in the Frame-Buffer. A pixel that is determined to be in-front of the pixel currently in the Frame-Buffer will be drawn over it. Pixels that are determined to be behind the pixel currently in the Frame-Buffer will not be drawn. Depth-Testing allows geometry in a 3D scene to occlude geometry behind it, and be occluded by geometry in-front of it regardless of the order the geometry was drawn.

For a more detailed description of Depth-Testing, refer to the Depth-Test article.


Depth Test depthtest - Enables and disables the Depth-Test. If the depth-test is disabled, depths values aren't written to the Depth-Buffer.

Depth Test Function depthfunc - - The depth value of the pixel being drawn is compared to the depth value currently in the depth-buffer using this function. If the test passes then the pixel is drawn to the Frame-Buffer. If the test fails the pixel is discarded and no changes are made to the Frame-Buffer.

  • Less Than less -
  • Less Than or Equal lessorequal -
  • Equal equal -
  • Greater Than greater -
  • Greater Than or Equal greaterorequal -
  • Not Equal notequal -
  • Always always -

Write Depth Values depthwriting - If Write Depth Values is on, pixels that pass the depth-test will write their depth value to the Depth-Buffer. If this isn't on then no changes will be made to the Depth-Buffer, regardless of if the pixels drawn pass or fail the depth-test.


Alpha Test

Alpha-testing allows you to choose to draw or not draw a pixel based on its alpha value.


Discard Pixels Based on Alpha alphatest - This enables or disables the pixel alpha test.

Keep Pixels with Alpha alphafunc - - This menu works in conjunction with the Alpha Threshold parameter below in determining which pixels to keep based on their alpha value.

  • Less Than less -
  • Less Than or Equal lessorequal -
  • Greater Than greater -
  • Greater Than or Equal greaterorequal -

Alpha Threshold alphathreshold - This value is what the pixel's alpha is compared to to determine if the pixel should be drawn. Pixels with alpha greater than the Alpha Threshold will be drawn. Pixels with alpha less than or equal to the Alpha Threshold will not be drawn.  


Wire Frame

The wire-frame feature will render the geometry as wire-frame, using the actual primitive type used in the render. What this means is surfaces like Metaballs, NURBs and Beziers will become a wire-frame of the triangles/triangle-strips used to render them (since these types of primitives can't be natively rendered in OpenGL).


Wire Frame wireframe - - Enables and disables wire-frame rendering with the option of OpenGL Tesselated or Topology based wireframes.

  • Off off -
  • OpenGL Tesselated Wire Frame tesselated -
  • Topology Wire Frame topology -

Line Width wirewidth - This value is the width that the wires will be. This value is in pixels.  


Cull Face

The cull face parameter will cull faces from the render output. This can be used as an optimization or sometimes to remove artifacts. See Back-Face Culling for more infomation.


Cull Face cullface - - Selects which faces to render.

  • Use Render Setting userender - Use the render settings found in the Render or Render Pass TOP.
  • Neither neither - Do not cull any faces, render everything.
  • Back Faces backfaces - Cull back faces, render front faces.
  • Front Faces frontfaces - Cull front faces, render back faces.
  • Both Faces bothfaces - Cull both faces, render nothing.


Polygon Depth Offset

This feature pushes the polygons back into space a tiny fraction. This is useful when you are rendering two polygons directly on-top of each other and are experiencing Z-Fighting. Refer to Polygon Depth Offset for more information. This is also an important feature when doing shadows.


Polygon Depth Offset polygonoffset - Turns on the polygon offset feature.

Offset Factor polygonoffsetfactor -  

Offset Units polygonoffsetunits -  


MATs
Constant • Depth • GLSL • In • MAT• MAT Common age• Null • Out • PBR • Phong • Point Sprite • Pointsprite • Select • Switch • Texture iltering• Texture Sampling arameters• Wireframe

An Operator Family that associates a shader with a SOP or Geometry Object for rendering textured and lit objects.

The OpenGL code that creates a rendered image from polygons and textures. Shaders can be made of up to three parts: Vertex Shader, Geometry Shader and/or Pixel Shader, which are either embedded inside Materials, or placed in Text DATs and referenced to a GLSL Material.

The location of an operator within the TouchDesigner environment, for example, /geo1/torus1, a node called torus1 in a component called geo1. The path / is called Root. To refer instead to a filesystem folder, directory, disk file or http: address, see Folder.

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

A surface type in SOPs including polygon, curve (NURBS and Bezier), patch (NURBS and Bezier) and other shapes like sphere, tube, and metaball. Points and Primitives are part of the Geometry Detail, which is a part of a SOP.

An Operator Family that associates a shader with a SOP or Geometry Object for rendering textured and lit objects.

An Operator Family that creates, composites and modifies images, and reads/writes images and movies to/from files and the network. TOPs run on the graphics card's GPU.

Operators that have 1 or more input, like a Math CHOP, are called filters. See Generator.

An Operator Family which operate on Channels (a series of numbers) which are used for animation, audio, mathematics, simulation, logic, UI construction, and many other applications.

A parameter in most CHOPs that restricts which channels of that CHOP will be affected. Normally all channels of a CHOP are affected by the operator.

An Operator Family that reads, creates and modifies 3D polygons, curves, NURBS surfaces, spheres, meatballs and other 3D surface data.

TouchDesigner is a hierarchy of components. "root" is the top-most network in the hierarchy. The Path is simply /. A typical path is /project1/moviein1.

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Path.

The term "Frame" is used (1) in the Timeline, (2) as a time-unit in CHOPs, (3) as a time-unit in TOPs, and (4) with movies images which are read and created with TOPs.

The connection of an output of one node to the input of another node in a network. In contrast, see Link.