Texture precision

Started by Mr_Chaos, June 29, 2014, 06:08:08 PM

Previous topic - Next topic

Mr_Chaos

A quick question about texture precision.

Is there a limit to how precise the u,v coordinates into a texture can be ?

I have 1 big (2048 x 2048) texture where every object maps into 4x4 pixels to get their current color (don't know if this the best way of doing it, but right now it kinda works) and if an object has to change size I dynamically change the texture and reupload it.
So far so good, but sometimes the object have some color from another object on the edges, so i was wondering if there is a limit to how precise the indexes can be ?

EgonOlsen

That's not a precision issue, it's caused by the bilinear texture filtering. If all you are using the texture for it to select a color, you might want to disable filtering on this texture (http://www.jpct.net/doc/com/threed/jpct/Texture.html#setGLFiltering(boolean)).
And maybe mip mapping as well (http://www.jpct.net/doc/com/threed/jpct/Texture.html#setMipmap(boolean))

Mr_Chaos

Quote from: EgonOlsen on June 30, 2014, 01:37:11 PM
That's not a precision issue, it's caused by the bilinear texture filtering. If all you are using the texture for it to select a color, you might want to disable filtering on this texture (http://www.jpct.net/doc/com/threed/jpct/Texture.html#setGLFiltering(boolean)).
And maybe mip mapping as well (http://www.jpct.net/doc/com/threed/jpct/Texture.html#setMipmap(boolean))

As always, your the man Egon!