TouchDesigner learning

From Antoine Vienne | Wiki
Revision as of 01:23, 20 January 2021 by Walter (talk | contribs) (Get Shadertoy shaders working)
Jump to navigation Jump to search

Making custom interface

Making buttons

// Name of the parent node

parent().name

Rendering

Get resolution from another node

// Get width and height from render1 node

op('render1').width

op('render1').height


GLSL

Get Shadertoy shaders working

More informations: https://nvoid.gitbooks.io/introduction-to-touchdesigner/content/GLSL/12-6-Importing-Shadertoy.html

// Replace in code "void mainImage( bla bla )" by "void main()"

// Replace in code "fragCoord" by "gl_FragCoord"
// Carefully add ".xy" when missing ".x" or ".y" after "gl_FragCoord" in "void main()" part

// Then add at top of code:

layout(location = 0) out vec4 fragColor;

uniform vec3 iResolution;
uniform float iTime;
uniform float iFrame;
uniform vec4 iMouse;

// In glsl node:
// Declare iResolution, iFrame and iTime
// For iTime:
absTime.seconds
// For iFrame:
absTime.frame