├── .DS_Store ├── .gitattributes ├── images ├── .DS_Store ├── base.png ├── page1.png ├── page2.png ├── setRange.png ├── textport.png ├── connectText.png ├── customize.png ├── setParams.png ├── setUniforms.png ├── uniformsSet.png ├── addUniforms1.png └── addUniforms2.png ├── shadertoy_converter.tox └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/.DS_Store -------------------------------------------------------------------------------- /images/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/base.png -------------------------------------------------------------------------------- /images/page1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/page1.png -------------------------------------------------------------------------------- /images/page2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/page2.png -------------------------------------------------------------------------------- /images/setRange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/setRange.png -------------------------------------------------------------------------------- /images/textport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/textport.png -------------------------------------------------------------------------------- /images/connectText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/connectText.png -------------------------------------------------------------------------------- /images/customize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/customize.png -------------------------------------------------------------------------------- /images/setParams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/setParams.png -------------------------------------------------------------------------------- /images/setUniforms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/setUniforms.png -------------------------------------------------------------------------------- /images/uniformsSet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/uniformsSet.png -------------------------------------------------------------------------------- /images/addUniforms1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/addUniforms1.png -------------------------------------------------------------------------------- /images/addUniforms2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/images/addUniforms2.png -------------------------------------------------------------------------------- /shadertoy_converter.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GregFinger/TD-Shadertoy_Converter/HEAD/shadertoy_converter.tox -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shadertoy Converter 2 | 3 | ![base](images/base.png) 4 | 5 | This converter is for taking shader code (ie. super slick glsl graphics) from [ShaderToy](www.shadertoy.com) and converting it for use in [TouchDesigner](www.derivative.ca) 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. 6 | 7 | ### The .tox component has 3 pages of custom parameters: 8 | 9 | 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. 10 | ![page1](images/page1.png) 11 | 12 | 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. 13 | ![page1](images/page2.png) 14 | 15 | 3. The third page is for the custom uniforms you add to the shader: 16 | 17 | a. Add a Text DAT, right-click on it and select "Edit Contents in Textport" and paste the shader code inside the textport. 18 | ![textport](images/textport.png) 19 | 20 | b. Define whatever uniforms you want in the code. The formatting needs to be: `uniform uName;` 21 | ![define](images/addUniforms1.png) 22 | 23 | c. Add the uniforms wherever you want 24 | ![add uniforms](images/addUniforms2.png) 25 | 26 | d. Connect the Text DAT to the first input 27 | ![connect](images/connectText.png) 28 | 29 | e. On the third page of the Shadertoy Converter, click "Set Custom Uniforms" 30 | ![set uniforms](images/setUniforms.png) 31 | 32 | f. Now you can see the uniforms are set and ready to be used 33 | ![uniforms set](images/uniformsSet.png) 34 | 35 | g. To adjust the default value and range, first right click on the Shadertoy Converter and select "Customize Component..." 36 | ![customize](images/customize.png) 37 | 38 | h. Then set the default and range values 39 | ![range](images/setRange.png) 40 | 41 | i. You can close the window and now see that everything is setup 42 | ![great success](images/setParams.png) 43 | 44 | The component comes embedded with this shader: https://www.shadertoy.com/view/MtXSD7, audio and a cubemap, so it works right away. 45 | --------------------------------------------------------------------------------