Here’s a component that uses the Shadertoy API to download GLSL shaders directly to TouchDesigner. The parameters of the component allow you to enter in a search term, sort the list by several different variables and change the number of results returned as well as the starting result number. The request time can be quite long so be prepared to wait about a minute when you refresh.
It uses a python script that makes a HTTP request to the Shadertoy website and returns a json list of individual shaders. Then a Replicator COMP copies a master COMP that contains a special network to convert the shader code. This bit is a bit incomplete and needs some help. Here’s a link to the api if you would like to see how it works:
[url]https://www.shadertoy.com/api[/url]
Most shaders compile but a good portion dont work. Hopefully I’ll have some time to refine this later on but any suggestions would be much appreciated. You can find the converter in /shadertoyBrowser/master0/programConverter
UPDATE:
Added in Tim’s webcam and audio bits as well as the ability to drag out shaders you like into your scene. Thanks Tim!
UPDATE 12/18/2019:
The Shadertoy API has changed since the creation of this component and it no longer works. td-shadertoy is the replacement for this project: td-shadertoy
Thanks TIm! Your changes have been incorporated into the originally posted file as well as a new feature that allows you to drag shaders you like out of the browser and into your scene.
Thanks Simplo, I’ll see about adding it in. Unfortunately not every case works and sometimes a fix for one will break another. Really there should just be a “Shadertoy” mode for the GLSL top that addresses these issues.
Shadertoy just added backbuffers in too so I’ll see about adding that into the inputs section. Then we will have some nice water/fluid/feedback effects.
The Soundcloud input is also MIA for the time being. Hopefully I’ll have time to play with it soon.