Shadertoy, how to adapt

Gary Leyrn's icon

Hello,

I am trying to adapt this shadertoy to work using the GL3 demo patch .
Could someone help to make this work , please ?

The code is divided in 2 sections :

Buffer A, and IMAGE.
I copy pasted the IMAGE section at the end of the BUFFER A section, but it does not work.

Max Patch
Copy patch and select New From Clipboard in Max.

And , my not-woking code adapt

mars.jxs
jxs 10.16 KB

PS.
Considering shaders using Buffer A, Buffer B, .... etc... IMAGE, how can we adapt this to make it work using this patch ? I tried Federico Foderaro tutorial about adapting these kind of shadertoys using several jit.gl.slab, but I am wondering if there is an easier method to adapt them using the GL3 demo patch.

Matteo Marson's icon

Hey Gary,

here's a working version:

Max Patch
Copy patch and select New From Clipboard in Max.

mars.jxs
jxs 10.24 KB

the shadertoy port wasn't working mainly for three reasons:
1) there was no "iTimeDelta" uniform variable. I created one in the main patch (red objects) and added it to the XML tags in the shader
2) The "Image" tab in the shadertoy isn't doing anything. I suppose it was created to display some comments and credits. Therefore there's no reason to replicate it in the shader.
3) the main function of the shader was missing the variable "fragCoord". I created it passing from the vertex shader the texture coordinates (un-normalized)
4) the dimension of the noise texture was arbitrary, it should depend on the dimension of the final render (objects marked in blue)

Rob Ramirez's icon

just a quick note to say that for delta times you can simply use jit.time.delta

Gary Leyrn's icon

Thank you guys,
Great.
Gary