TouchDesigner Vertex Shaders 02 - Kalaidescopic Layers

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • We continue our exploration of vertex shaders in TouchDesigner in this video, writing a custom Vertex and Fragment shader for a GLSL material that will allow us to create and composite layers of a texture to generate kalaidescopic visuals.
    I have included the boilerplate code for the GLSL rotation matrix below in the description, as well as on my patreon.
    Project files with postprocessing: www.patreon.com/water__shed
    00:00 - Start
    00:23 - Overview and Motivation
    01:38 - Render Setup
    05:31 - Shader Setup
    10:01 - Vertex Shader
    17:26 - Fragment Shader
    23:44 - Scaling UV Coordinates with Texture SOP
    SHADER PREPROCESS DIRECTIVE CODE
    _____
    #define TWO_PI (PI*2.0)
    #define deg2rad (PI/180.0)
    mat4 rotMatXYZ(float xRot, float yRot, float zRot) {
    float a = xRot*deg2rad;
    float b = yRot*deg2rad;
    float g = zRot*deg2rad;
    return mat4(
    cos(b)*cos(g), cos(g)*sin(a)*sin(b)-cos(a)*sin(g), cos(a)*cos(g)*sin(b)+sin(a)*sin(g), 0.,
    cos(b)*sin(g), cos(a)*cos(g)+sin(a)*sin(b)*sin(g), -cos(g)*sin(a)+cos(a)*sin(b)*sin(g), 0.,
    -sin(b), cos(b)*sin(a), cos(a)*cos(b), 0.,
    0., 0., 0., 1.
    );
    }
  • Krátké a kreslené filmy

Komentáře • 3