Assigning texture coordinates

Started by
3 comments, last by dpadam450 12 years, 10 months ago
So openGL uses 0,0 to 1,1 for texture data

How do I avoid rounding errors if I want pixel perfect mapping? ( from pixel_location / texture_size divisions )
Advertisement
Are the rounding errors a problem for you, and if so, how is it a problem?
not yet Im just thinking bout this ahead of time

Im just guessing that there will be some situations where I will get a pixel off at the borders of each quad

Maybe Im just wrong?
If that's the case, then the problem is not precision but how you align your texels to the screen. You can always fix the little precision issue there is by rounding; or in filtering terms, use GL_NEAREST. You should look into how you align your texels instead if it becomes a problem.
I've never noticed a problem. You can use GL_CLAMP, or GL_CLAMP_TO_EDGE something like that for glTexParameter. GL_NEAREST will not give you any linear/mipmapped filtering. Unless you have a specific use that you don't need mip mapping.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement