Shadertoy Browser

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

The converter is based on the code by Sebastien Gravel found here: [url]https://github.com/SebastienGravel/ShaderToyTouchdesigner[/url]

Happy 2016!

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

Nice work, wish I could contribute, but my GLSL is weak. :wink:

Nice one! Definitely be checking this out

Fantastic work! Thank you

I spent a little time and got the webcam samplers working.

  1. Check /shadertoyBrowser/webcam and make sure your cam is set up.
  2. I made some changes to the program converter - iChannel# is now converted to sTD2DInputs[#].
  3. In the source items there was an op named, img_. Renamed this to img_buffer

shadertoyBrowser.webcam.toe (95.5 KB)

Cheers,
Tim.

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.

Greaaaaaaaaat!!
Thank you very much!!
I didn’t had the time to analyze your code with attention, but it seems you are not converting this case:

  • vec2 p = (-iResolution.xy + 2.0*fragCoord.xy)/ iResolution.y; -
    I subtitute it with
  • vec2 p = 2 * vUV.st - 1.0; -

I hope it will be useful!

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. :slight_smile:

The Soundcloud input is also MIA for the time being. Hopefully I’ll have time to play with it soon.

Great Matthew!
My GLSL skills are very slow, but if I can help you with some testing, Iìm at your disposal!