alpha mask from binary video applied to jit.gl.sketch. need some help

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

hi! i need some advice in my patch. i would like to recreate the whole section in left, but using open gl. i v started something, on the right side of mypatch, but i have stuck. Big thanks for any help!
adam

2921.export.jpg
jpg
Zachrkn's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You were very very close. You just need to have a jit.gl.texture object to pick up the texture that was captured by your sketch object. I made the very slight alterations, see below.

ćwiek's icon

wow thanks :)
do you know, how to improve quality when i go fullscreen, or simply resize? the sharp edges are getting blury, and the lines are so fat..

2925.test2.maxpat
Max Patch
Zachrkn's icon

The default dimensions of the jit.gl.texture object are 256x256. By adding to the jit.gl.texture object the argument "@dim X Y" where X and Y are your dimensions, you can adjust that.

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

thats great, thanks again for advice! :)
i have got another little question. now i am going, to use spot light (max 6), to glow only some parts of silhouette. when i send attribute lightning_enable 1 to jit.gl.videoplane i am again loosing resolution. i figured out, that videoplane also gets @dim, but when i resize it to 1280/720 it looks great, but the framrate is going down. shuldnt it be rendering by gpu? i dont understand it.. Do you know what could be wrong?

Wesley Smith's icon

From your post, I wasn't sure if you were changing the texture's dim to 1280x720 or videoplanes. Your patch changes the texture's, which shouldn't cause any big slowdown. The videoplane's dim is for geometry, not image resolution, so it could be set to jit.gl.videoplane @dim 2 2 and be perfectly fine.

- you might want to consider using jit.gl.node for capturing to texture. It can be used to clarify what's going on in the patch and also automatically adapts the texture resolution to the windows be default. With a small resolution, the rendering is very blocky, but at fullscreen looks great.

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

- you might want to consider using jit.gl.mesh instead of jit.gl.sketch if you're drawing a ton of lines. It will be much much faster.