m.gnu.
02-07-2008, 07:55 AM
Hi,
this is the same issue that I've talked about in the glsl-forum (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=233247#Post233247) but since the error didn't have anything to do with shaders, I'll be annoying and post the same question here...
I've got a really simple glut-application (http://www.mediafire.com/?6rnzrjpxxm1) in which I create a 2x4 texels big 2D-texture (which is power of two) and apply that texture to a quad.
I set the texture to hold floating point GL_LUMINANCE values and define them to the following:
0.1 0.1
0.1 0.1
0.5 0.5
1.0 1.0
If I apply this texture using a nearest-neighbour lookup I would expect to get the following behaviour:
texcoord.y 0.749999 returns 0.5
texcoord.y 0.75 returns 0.5
texcoord.y 0.750001 returns 1.0
This is what I actually get:
Nvidia gf8800 with latest drives:
texcoord.y 0.749999 returns 0.5
texcoord.y 0.75 returns 0.5 (some precision errors here, some fragments are 0.5 some are 1.0)
texcoord.y 0.750001 returns 1.0
I would say that Nvidia follows my expectations, ATI on the other hand...
ATI hd2900 with latest drivers:
texcoord.y 0.7480 returns 0.5
texcoord.y 0.7481 and all above returns 1.0
If I haven't done something REALLY stupid in my application, I'd say that this is an ATI bug\feature here. Those precision errors are not really acceptable... Can someone confirm my findings? (and maybe suggest how to proceed with the issue...)
I have tried to use an ordinary RGB texture format, with no luck. I have tried to use glsl-shaders for texturing, with no luck. I have tried to use a NPOT-texture, with no luck. I have tried to use a 3D-texture, with no luck... maybe I should try a 1D-texture ;)
If you run my app, you can switch between different y-texcoords with keys 1 through 5.
this is the same issue that I've talked about in the glsl-forum (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=233247#Post233247) but since the error didn't have anything to do with shaders, I'll be annoying and post the same question here...
I've got a really simple glut-application (http://www.mediafire.com/?6rnzrjpxxm1) in which I create a 2x4 texels big 2D-texture (which is power of two) and apply that texture to a quad.
I set the texture to hold floating point GL_LUMINANCE values and define them to the following:
0.1 0.1
0.1 0.1
0.5 0.5
1.0 1.0
If I apply this texture using a nearest-neighbour lookup I would expect to get the following behaviour:
texcoord.y 0.749999 returns 0.5
texcoord.y 0.75 returns 0.5
texcoord.y 0.750001 returns 1.0
This is what I actually get:
Nvidia gf8800 with latest drives:
texcoord.y 0.749999 returns 0.5
texcoord.y 0.75 returns 0.5 (some precision errors here, some fragments are 0.5 some are 1.0)
texcoord.y 0.750001 returns 1.0
I would say that Nvidia follows my expectations, ATI on the other hand...
ATI hd2900 with latest drivers:
texcoord.y 0.7480 returns 0.5
texcoord.y 0.7481 and all above returns 1.0
If I haven't done something REALLY stupid in my application, I'd say that this is an ATI bug\feature here. Those precision errors are not really acceptable... Can someone confirm my findings? (and maybe suggest how to proceed with the issue...)
I have tried to use an ordinary RGB texture format, with no luck. I have tried to use glsl-shaders for texturing, with no luck. I have tried to use a NPOT-texture, with no luck. I have tried to use a 3D-texture, with no luck... maybe I should try a 1D-texture ;)
If you run my app, you can switch between different y-texcoords with keys 1 through 5.