Shadertoy to jit.pix

encoder audio's icon

Hi Guys,

Could somebody help me out?
I've checked the forum, but still don't know how to do it properly...porting simple shadertoy codes into jit.pix codebox.

Like this one :
https://www.shadertoy.com/view/XsXXDn

It seems pretty simple :S

Graham Wakefield's icon

There's lots of discussion about this in the forum history; a search of "shadertoy" returns many results:

Basically, Shadertoy provides a bunch of useful parameters and functions, that you would have to emulate in a jit.gl.pix port, including some glsl functions (e.g. mat4 functions). Also, the way textures are handled might be a little different -- what Shadertoy does for you in the web page, you will need to do in your max patch. But most of these problems have been solved in the forum posts linked above.

Rob Ramirez's icon

some additional info:
fragColor = out 1
fragCoord = cell
fragCoord / iResolution = norm
iResolution = dim

codebox doesn't allow you to assign vector components (e.g. p.x = some expr), so you have to use vec or concat for that.

jit.time (from the jit.mo package) is very useful for iGlobalTime.

this gets close to the original:

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

encoder audio's icon

Checked a few examples from here, and successfully ported one of my favs from Shadertoy, with jit.gl.slab

Still have to learn how to modify the code, like background colour, etc.

rorschach.jxs
jxs 3.38 KB

rorschach.maxpat
Max Patch