/TD-Shadertoy_Converter

easiest shadertoy converter ever. EVER

Shadertoy Converter

base

This converter is for taking shader code (ie. super slick glsl graphics) from ShaderToy and converting it for use in TouchDesigner and setting up control to interact with parameters that affect the graphics. The .tox component has 6 inputs. The first input is the shader code DAT. The second input is for an audio CHOP. The remaining four are TOP inputs. These inputs can be 2D textures or cubemaps.

The .tox component has 3 pages of custom parameters:

  1. The first page sets the iChannel[0-3] inputs, which you can choose 2D Texture, Cubemap or Audio. Set these according to what the shadertoy source has as its iChannel inputs. page1

  2. The second page sets the resolution of the output, has an adjustment for the speed of iTime, turns off/on mouse control (which the mouse interactivity happens within the TD window) and adjusts the gain for the audio inputs. page1

  3. The third page is for the custom uniforms you add to the shader:

    a. Add a Text DAT, right-click on it and select "Edit Contents in Textport" and paste the shader code inside the textport. textport

    b. Define whatever uniforms you want in the code. The formatting needs to be: uniform <type> uName; define

    c. Add the uniforms wherever you want add uniforms

    d. Connect the Text DAT to the first input connect

    e. On the third page of the Shadertoy Converter, click "Set Custom Uniforms" set uniforms

    f. Now you can see the uniforms are set and ready to be used uniforms set

    g. To adjust the default value and range, first right click on the Shadertoy Converter and select "Customize Component..." customize

    h. Then set the default and range values range

    i. You can close the window and now see that everything is setup great success

The component comes embedded with this shader: https://www.shadertoy.com/view/MtXSD7, audio and a cubemap, so it works right away.