what is texture2D in jit.gl.pix codebox ?

Andro's icon

Hi everyone,
I'm almost there with converting this shader from shadertoy
https://www.shadertoy.com/view/4dXSzB#
The one part I'm stumped on is how to define a
-texture2D within jit.gl.pix codebox

I've seen from the jit.gl.pix td.repos example that texture2Drect = sample(in1, norm);

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

Could someone point out what I'm missing.
I've posted the patch I have which is very close to working.

LSka's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I think I'm almost there.

The problem now is how to obtain a smooth "rain texture"... it seems there's some kind of antialiasing active in the shadertoy player, but I don't know how to reproduce it with Jitter.

LSka's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Ok, this looks nicer:

Rob Ramirez's icon

super cool guys.
for the record, you can replace uv = cell / dim; simply with the gen operator norm

Andro's icon

Hi Lska,

Thanks for taking the time to do this, its made (again !) a lot clearer to me how to convert things into codebox. :)
(plus for the wiki tuts that I'm working on converting)

Have to get in my head that codebox handles things like this
vec2 where = (uv.xy-raintex.xy);
to this
where = uv-raintex;

So in codebox is there no "real" difference between texture2D and texture2Drect ???

I think that the 1 plane 2d texture is just probably a high resolution image. If i put the dim setting on the jit.bfg to 256 256 I get a pretty smooth rain effect.

Thanks a million !

Graham Wakefield's icon

You already have it -- sample().

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

I think the trick was that you didn't need the vec() wrapper in assigning to "where". This looks pretty similar to me:

Andro's icon

Thanks everyone !