Here is a little something we (by WE I mean my colleague Sebastien Gravel from Création Ex Nihilo) did to ease the pain while trying out shaders from Shadertoy.com for the first time in TD.
This patch converts the shader code found on the website shadertoy.com and makes it usable in Touchdesigner.
Copy the program shader code from the website in the shaderProgram DAT.
Notice
Works with 60% of the shadertoy.com available.
The texture use on shadertoy.com must be reimported in touchdesigner and assigned to the input of the glsl TOP.
Basic uniform like iResolution, iMouse and iGlobalTime are already assign in the uniform section of the glsl TOP, if some shaders use other types of uniforms, those should be added by hand.
Audio input doesn’t work for now.
Bug
Some shader don’t compile correctly with raymarching and textureCube, feel free to experiement and look if a solution is available or if this is a Touchdesigner limitation of the sampler type.
To get the patch go to our Github or download straight from here:
One of the most common errors I always see when trying to port shadertoy stuff is something like this:
Program Link Results:
Fragment info
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
any ideas?
some run with the “void mainImage()” and some with that method don’t strangely.
Hello, I have noticed that some of the shaders use a channel from the channel picker down bellow the code . It is mostly noise ,sooo i was wondering if there is a way to use a Noise Top and somehow convert that information into a code reference and write it in the code itself.
What do you mean by mainImage() needs to be renamed to main().
could you develop a bit? thx
I dont even see any traces of a mainImage in the code.
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
(0) : error C3001: no program defined
If youre looking for more explanation on how to convert Shadertoy shaders to TouchDesigner and why certain things change, Matt wrote a great chapter on it here. Might answer your question.