Jitter-Lua 3dTexture read / write problem

Pis Pas's icon

We are trying to get 3d textures in Lua but we have no success.
There is an example file attached with a Lua script and two shaders (one is writing to texture and the other one is reading the texture).
The output should be red. Sure I'm missing something obvious...

Any help will be much appreciated!!

Thanks

texture3DTest.zip
zip
Pis Pas's icon

I've noticed that if you turn high_res in jit.gl.world on/off the result is as expected (red)...
No clue what's going on.

Pis Pas's icon

Oh.. and we are on win10 btw

Pis Pas's icon

Just in case someone wants to test this on apple. Here is an opengl 120 version .

Pis Pas's icon

for some reason the forum doesn't allow me to upload a rar file. Here is a zip version..

texture3DTest_v120.zip
zip
Rob Ramirez's icon

hi Luca.

i'm sorry to say, but Jitter does not support capturing to a 3D texture. currently, the only way to write to a 3D texture is via matrix input.

Pis Pas's icon

Thanks Rob, but thats a bummer.

I can't really understand why this isnt implemented. I mean, if c74 include the read functionallity for 3d Textures, why not also the write function? We are talking about a few more lines of code here...

Simone Milano's icon

Hi Rob! Is it possible to generate a texture (maybe with jit.gl.pix) and convert it to an image? And then use the image as input for a jit.gl.cubemap? Thanks in advance!

Rob Ramirez's icon

sure, you can either readback to matrix by sending the texture to a jit.matrix object, or using jit.gl.asyncread. depends on your specific needs what will work better for you.