Iterations in jit.gl.pix?

Matteo Marson's icon

Hi everybody,

I'm wondering if it's possible to make iterations within jit.gl.pix.
Usually if I need a state of memory I simply put a texture into another jit.gl.pix object (or jit.gl.slab) and then feed it back. This way the readback occours every frame; but:

1) What if i'd like to make multiple iterations within a single frame?
2) is there any way to easily code (maybe into a codebox object) iterative structures for complex tasks? (for example for finding nearest neighbour, sorting or stuff like that)
3) Last but not least, is out there any well put together piece of documentation on codebox language for jit.gl.pix?

Thanks!!

Graham Wakefield's icon

Yes you can do iterations on a single frame, but only through using codebox (for loops and while loops).

Here's an example of using a for loop to render a sphere via the distance function method (aka sphere tracing):

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

Graham Wakefield's icon
Matteo Marson's icon

Thanks!!!!
This is exactly what i was looking for!!

damacell damacell's icon

Thanks for upload GRAHAM WAKEFIELD! I have found it for a long time.