PDA

View Full Version : Skybox Edge Artifact w/Radeon



pleopard
05-26-2003, 07:58 AM
I just bought a Radeon 9800 Pro 128 and have been running some demo apps compiled previously and run on a GeForce3 Ti500 without a problem. On the Radeon I get an artifact where the edges are highlighted in black such as in this picture (http://bellsouthpwp.net/l/e/leopardp/9800Artifact1.jpg). Anyone have a clue as to why I see this on the Radeon and not on the GeForce?

Mazy
05-26-2003, 08:12 AM
That seams like you use GL_CLAMP, instead of GL_CLAMP_TO_EDGE.. the nvidia drivers (wrongly) force GL_CLAMP to act as GL_CLAMP_TO_EDGE if you dont disable that in the drivers

pleopard
05-26-2003, 08:31 AM
Excellent, that was it precisely. Thanks for the good input ... Till now, I have been developing on nVidia cards exclusively for a long time ... I had no clue that the nVidia drivers were in error.

this did the trick ...



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Set the texture objects and apply the necessary properties to each (order
// is Top, Bottom, Right, Left, Front, Back

void MgSkyBox::setTextures(size_t textureIndices[6])
{
memcpy(m_Textures,textureIndices,sizeof(size_t)*6) ;

// Detect the GL_EXT_texture_edge_clamp extension and use it if present
int clampMode;

if (IsOpenGlExtensionSupported("GL_EXT_texture_edge_clamp"))
{
clampMode = GL_CLAMP_TO_EDGE;
}
else
{
clampMode = GL_CLAMP;
}
for (int i=0; i<6; ++i)
{
glBindTexture(GL_TEXTURE_2D,m_Textures[i]);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_RE PLACE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,cl ampMode);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,cl ampMode);
}
}




[This message has been edited by pleopard (edited 05-26-2003).]

Obli
05-26-2003, 09:39 AM
Originally posted by Mazy:
...the nvidia drivers (wrongly) force GL_CLAMP to act as GL_CLAMP_TO_EDGE...

Have I got it right? This means that under NV GL_CLAMP has the same effect that GL_CLAMP_TO_EDGE?
Oh well, I don't like this. How can I disable it in the driver (if possible)?

Mazy
05-26-2003, 10:56 AM
In the driver settings, under nvidia/opengl you find 2 checkboxes, one of them (you know when you see the name, i got localized so my text wont help you)

Its not really a bug (i dont want to backtalk nvidia here) it is really a feature, because mot of the time when a openglprogram uses GL_CLAMP they really wanted GL_CLAMP_TO_EDGE, but that was an extension and i guess many companies rather used the GL_CLAMP instead of checking and using the extension..

Whats bother me is the fact that it replaces the token by default.. that should be changed.

edit : ops, in my 44.03 drivers its of by default, if it remembers my last settings or if they change it i dont know.. but if its off by default i just say - god work, and keep it that way.

[This message has been edited by Mazy (edited 05-26-2003).]

pleopard
05-26-2003, 02:22 PM
Ahhh it is "Enable conformant OpenGL texture [clamp] behavior"

Thx!


[This message has been edited by pleopard (edited 05-26-2003).]

Obli
05-27-2003, 09:31 AM
I don't find the checkbox... No wait, maybe it's this one (which, once traduced means a totally different thing from what you said - the worse translation ever).

Oh well, I must say that even if I don't like it, it is a nice idea, especially for beginners.

EDIT: thank you!


[This message has been edited by Obli (edited 05-27-2003).]

V-man
05-27-2003, 03:50 PM
So you are trying to find the checkbox and at the same time typing this? Too bad this isnt a chat room http://192.48.159.181/discussion_boards/ubb/smile.gif

PS: I tried this a long time ago (I think on a GfMX) and the performance dropped like a rock. I'm not sure why. Maybe software mode is beeing used because the MX cant do GL_CLAMP? And it's not fully software mode, because I think I would have gotten lower than 1FPS otherwise.

jwatte
05-27-2003, 06:17 PM
GeForce2 doesn't support GL_CLAMP, so checking the check box reverts to software mode.

GeForce3 and up do support proper GL_CLAMP, but apparently enough applications relied on the old behavior that they found it best to make the default be to preserve the old, non-standard (but understandable) behavior.