Avoid texture interpolation for small matrices

Jul 14, 2013 at 2:59am

Avoid texture interpolation for small matrices

Hello everybody,

this is much more a theoretical issue, than a practical one. Anyway…
please have a look at the patch below:
<code>

– Pasted Max Patch, click to expand. –

</code>

I am generating a very simple texture, made of 7 coloured bars, actually a 7×1 matrix.
When I send it to texture, I get interpolation, thus the bars fade smoothly into each other (this is what you see choosing tex1 in the example patch).
To get solid bars, I need to resize the matrix to 320×240 (which is the corresponding value of “dest_dim” in the gl.render. I tried changing dest_dim value, but nothing happened), you can see the desired effect in tex2.

As for now, resizing the matrix is not a great issue, but I’d like to know if there is some way to turn off texture interpolation, so one can use very small matrices and (i guess) save some CPU in very stressing patches.

#255961
Jul 14, 2013 at 8:51am

set @filter none on your jit.gl.texture

#255979
Jul 14, 2013 at 12:02pm

Thank you Rob, that’s perfect.

<code>

– Pasted Max Patch, click to expand. –

</code>

#255988

You must be logged in to reply to this topic.