Author Topic: Texture precision  (Read 845 times)

Offline Mr_Chaos

  • int
  • **
  • Posts: 57
    • View Profile
Texture precision
« on: June 29, 2014, 06:08:08 pm »
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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Texture precision
« Reply #1 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))

Offline Mr_Chaos

  • int
  • **
  • Posts: 57
    • View Profile
Re: Texture precision
« Reply #2 on: July 01, 2014, 11:19:08 am »
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!