jit.movie to jit.pix

wbreidi's icon

Hello, I am trying to adapt the Gen tutorials to do something with video instead of a webcam. But every time I switch from the webcam to playing a [jit.movie] video my [jit.world] frame rate goes down from 30 to 3 fps! I know there is something basic I am missing but I can’t figure out what it is! Any suggestions?

colormap_walid.maxpat
Max Patch

Rob Ramirez's icon

your main issue was your signal path from the jit.movie. you had output_texture disabled so jit.movie outputs a matrix, then you sent that to a jit.gl.texture (upload to the gpu), then you sent that to a jit.matrix (readback to the CPU) then you processed with CPU objects (jit.pix) then back to the GPU (jit.gl.videoplane).
so the flow is something like:
CPU -> GPU -> CPU -> CPU -> GPU

what it should be is GPU -> GPU -> GPU

this is possible simply by enabling output_texture in the jit.movie and converting the jit.pix to jit.gl.pix

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

read the following article for more info : https://cycling74.com/tutorials/best-practices-in-jitter-part-1

wbreidi's icon

Ah yes of course, thanks a lot for the correction and the reference. I will definitely read it. Cheers