Matrix comparison to jit.gl.pix
Hello,
I'm new to gl.pix and run into this simple issue:
I'd like to convert this:
jit.op @op < @val 0.5
to a jit.gl.pix
How can I use a float param in this case?
Thanks, zb
Here is the answer to your question:
Now the problem, that I am also trying to figure out myself, is how to avoid the smoothness of the pixels that come from a matrix into the texture world. I've had some success using jit.gl.texture, but then I've found that later on it will cause some other problems, as I've reported on that other thread.
Good luck with your patch!
To avoid the smoothing, run the texture through [jit.gl.texture @filter none]. Have a look at the patch.
\M
Dear Mattyo,
Thank you so much for chiming in.
Unfortunately, as soon as you pass the output of jit.gl.texture to a jit.gl.pix the smoothing comes back again. Do you have any thoughts about this? (jit.gl.pix doesn't seem to have a @filter attribute either)
O
sendoutput filter none
Hi Omar,
You just have to put the jit.gl.texture at the very end of your processing chain before you send it out to your videoplane or whatever. I'm no gen guru, but I'm pretty sure there isn't a way to achieve this inside jit.gl.pix. However, it doesn't really cost you anything to stick that jit.gl.texture on at the end...
\M
As usual, it looks like Rob has the answer!
Sorry I am bit lost here: where do I type "sendoutput filter none"?
Send it as a message to the jit.gl.pix:
oooo, very sleek. I understand now that jit.gl.pix is, in effect, like a jit.gl.texture as input, jit.gl.texture as output, and some other (gen) things in the middle. But you can still change some properties in those hidden jit.gl.texture "inlets and outlets" by sending them a direct message. Crazy!
Thanks.
No problem, but ultimately Rob gets the credit!
\M
Hi everyone! I'm confused by the original solution that Och posted. The jit.gl.pix produces a red square, whereas the jit.op produces a white square. Why is there this different behavior? I'm working on replacing all the matrix objects with jit.gl.pix or jit.gl.slab, and I'm stumped trying to replace a jit.op !- @val 255 with a jit.gl.pix object. Any help would be greatly appreciate!