View Full Version : Integer texture coordinates.
Skorche
2005.04.28, 03:30 AM
So according to the red book, the coordinates passed to glTexCoord2i() are interpreted instead of being clamped. I seem remember using this before in a simple 2D program that I did before, but now when I use it, it just seems to act as a floating point value. What gives? Am I forgetting to enable some magic state?
OneSadCookie
2005.04.28, 03:43 AM
buh?
int x, y;
glTexCoord2i(x, y) is equivalent to glTexCoord2f(x, y)
Puzzler183
2005.04.28, 09:12 AM
The only time coordinates aren't treated on [0, 1] (wrapped there or clamped) is for rectangular textures (AFAIK).
arekkusu
2005.04.28, 11:44 AM
The TEXTURE_WRAP state affects how coordinates outside [0, 1] are interpreted. For example with MIRROR_CLAMP, coordinates in the [1, 2] range and >2 will be different.
Skorche
2005.04.28, 02:24 PM
The Red Books description of glTexCoord*()
...
Note that integer texture coordinates are interpreted directly instead of being mapped to the range [-1, 1] as normal coordinates are.
What does that mean then? I could swear that I'd used that before to specify coordinates like you would for rectangle textures. Or, maybe I'm just remembering that I thought you could use them like that...
Anyway, is there any way to use texel aligned coordinates without messing with the texture matrix stack all the time?
Puzzler183
2005.04.28, 02:49 PM
For the texel aligned stuff... Just don't worry about it. It shouldn't be causing any problems anyway (unless you have stuff bleeding into borders in which case there is an extension to fix that).
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.