jit.gl.meshwarp doesn't show video?

Haotian Yu's icon

Maybe there's something obvious I'm missing here, but I couldn't find anything about this on the forums yet: jit.gl.meshwarp works well with basically any video source (usually even with direct matrix input) but won't display a specific source video I'm sending (which is a standard 4 plane jit.matrix - generated by some basic color controls).

1) The source video displays fine when I connect it directly to a jit.pworld, also after I put it through a jit.gl.texture - so it's probably not a texture conversion issue

2) The jit.gl.meshwarp connected to the source video is making a layer as expected, but it's transparent / showing nothing

3) Basically anything else works - I included a fairly random jit.expr here which displays fine when connected to the same jit.gl.meshwarp

(Sorry for the badly organized patch, this is pulled out of a bigger patch)

meshwrap-test3.maxpat
Max Patch

TFL's icon

The matrix named red has its entire alpha channel filled with zeroes, which means full transparency. In the subpatcher feeding the matrix, replace your "clear" message by "clear, fillplane 0 255" and then you'll be able to see the matrix with jit.gl.meshwarp.

Haotian Yu's icon

Thanks again for your help - that solved it. But now I'm starting to wonder why a totally transparent video shows up at all in the jit.pworld or jit.pwindow but not in the jitter world itself.

TFL's icon

Because of the way they handle blending. When you send a texture/matrix straight into jit.pworld, I guess it is equivalent as sending it into a jit.gl.videoplane rendered into this world. By default jit.gl.videoplane has @blend_enable 0, which will make you see the colors regardless of the alpha channel.

jit.pwindow will simply not blend at all, so the alpha channel won't have any impact on what you see on it.

And I guess jit.gl.meshwarp necessarily work with blend enabled, so transparency will be rendered no matter what.

See here how you can make your matrix to disappear/appear when you enable/disable blend_enable of the videoplane.

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

Hello, I don't know how to record a jit.gl.meshwarp rendering in jit.world with an image in jit.movie. I'm trying jit.record with jit.matrix but only records the movie and not the meshwarp rendering.

Thanks

Wil's icon

simply draw jit.world to jit.gl.asyncread connect to jit.record


Joao Ferreira's icon

Hi Will,

Thank you for your answer, I tried your solution but it seems a more complex problem. I join my patch if you have time to take a look and tell me what's going wrong I really appreciate.

Best regards. Joao

jit.gl.meshwarp Joao2.amxd
amxd

TFL's icon

You didn't applied WIL solution correctly. You need to specify a @drawto attribute to your jit.world and set the same name as an argument in [jit.gl.asyncread].

So if you set [jit.world Human @fsaa 1 @floating 1 @drawto record] and [jit.gl.asyncread record] it will work. This said, make sure to disable (enable 0) jit.gl.asyncread when you are not recording, as it can impact performance.

An alternative way to this is to externalize the recording by using Spout (Windows) or Syphon (Mac). Check the forum and Max package manager for examples.

Rob Ramirez's icon

the simple solution to recording jit.word output is to enable output_matrix , and patch that directly to a jit.record.

Joao Ferreira's icon

Hello everybody,

It's ok now. Thank you very much. Best regards. Joao