using srcdim attributes with gl.texture??

Feb 7, 2014 at 12:28pm

using srcdim attributes with gl.texture??

Hiya

Quick question here (search isn’t working on the site).

I have a video module that takes incoming video, selects a portion of it (cropping, essentially) and outputs it. Previously I was simply using an internal [jit.matrix @usescrdim] and giving it different srcstart/end values.

I’ve since moved my system into the GPU realm, but I can’t figure out how to do this simple operation using [jit.gl.texture]. I don’t want to use the subtext method because that means I’d need to go back into the CPU domain at some prior point. The srcdim attributes don’t seem to work with g.texture.
Any advice? Thanks a ton!

#280361
Feb 7, 2014 at 1:20pm

I think what you’re referring to is in the jit.gl.texture maxhelp. The subtex_matrix tab – dstdimstart and dstdimend

#280362
Feb 7, 2014 at 1:31pm

Oh I see, You need td.rota.jxs

#280368
Feb 7, 2014 at 3:09pm

I can’t use subtex_matrix because that requires converting the incoming texture back to a jit_matrix, which defeats the point.

I don’t want to use td.rota.jxs because its parameters aren’t easy to work with. i.e. I’d like to define the region of the incoming video that I’d like to use by describing a rectangle (a la srcdim).

This seems like it should be a trivial operation! Perhaps there is a shader file i’m overlooking that does this? It should really be supported natively with gl.texture.
Hrmph.

#280378
Feb 7, 2014 at 3:36pm

here’s a simple jit.gl.pix based solution to crop textures using pixel parameters:

<code>

– Pasted Max Patch, click to expand. –

</code>

#280384
Feb 8, 2014 at 4:19am

That’s why I then suggested td.rota.jxs – see the texdisplace folder inside Jitter examples. Saying that, I think Rob Ramirez’s jit.gl.pix version will probably be faster.

#280403

You must be logged in to reply to this topic.