Texture clamp - Windows / Linux difference

Hi,

I have written some code working on Windows and Linux. I’m able to get the rendered OpenGL image and write it in a TGA file.
I have the same results when rendering the same code under Windows and Linux (modulo 1 unit in the color values, for unsigned char color values). It have been tested with texture repeat, blending, multi-texture…

My problem is : when I use a clamped texture, I don’t obtain the same result on the 2 OS for the clamped zone on the rendered textures.
I have the same problem with multi-texturing if one texture is clamped.
Has anyone seen that ? Is anyone know how to solve that ?

I’m using the clamp on S and T. And the mapping is set to LINEAR.

Cheers
Benoit

It sounds like the GL_CLAMP versus GL_CLAMP_TO_EDGE problem.
The nvdidia drivers have been silently replacing GL_CLAMP to the EDGE version, now it is a switch in windows graphic control panel.
http://www.nvnews.net/vbulletin/showpost.php?p=510663&postcount=9

Normally using GL_CLAMP_TO_EDGE everywhere should give predictably the same results.

BTW what hardware and drivers version are you using ?

Is this running on the same graphics hardware?
Which one is your expected result?

Some HW doesn’t support GL_CLAMP, but only GL_CLAMP_TO_EGDE.
GL_CLAMP with linear filter should include the texture border color or texture border texels depending on the downloaded texture (without or with border texels).
The texture border color is black by default. If your linear filter with GL_CLAMP shows darker colors at the edge, that’s the correct result. If you don’t want that use GL_CLAMP_TO_EDGE in your application.

If you really wanted GL_CLAMP and it’s not darker, I’ve seen an OpenGL option in NVIDIA control panels to use spec conformant clamping. On older hardware which didn’t support that, the rendering fell back to software. You probably don’t want that either. :wink: