problems with glTexParameteri

Started by
2 comments, last by Yann L 18 years, 7 months ago
I'm doing a Skybox. When I create a texture, I do this: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); but I see ugly lines. I have to change GL_CLAMP to GL_CLAMP_TO_EDGE but DevCpp not compiles good. Some Idea?? thx
Advertisement
I have the same skybox problem - anyone have a solution? It is a commercial one, from Darkmatter, so I would think it would be perfect.

According to MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_9upe.asp
GL_CLAMP_TO_EDGE is not available for glTexParameteri. It's either clamp or repeat.
Its not present because the MSDN docs only cover up to OGL1.1, iirc GL_CLAMP_TO_EDGE was added in 1.2, as such it wont be in their documentation.

If you want to use it you'll either have to include glext.h which defines it or just include the header from an extension loading library (see the Forum FAQ for details on them).
Of course Phantom is correct, and you'll have to include an extension handling mechanism sooner or later anyway. But if you just want to test your skybox without changing too much of your code, just define it manually:
#define GL_CLAMP_TO_EDGE 0x812F


BUT (big BUT): clamp to edge will not solve all your skybox edge problems. It will alleviate them, and depending on the skybox texture they may almost dissapear or become acceptable. But often, you will not get rid of them that easily (well, except by switching off bilinear filtering, but ugh..). If you want a perfect skybox, you will need to add a manually generated border around each image, which duplicates the texel values from the adjadcent textures. Then, the texture coordinates need to be adjusted in such a way, that the linear filter functions flows seamlessly from one texture to the next. GL_CLAMP_TO_EDGE is not need anymore for this (but can't hurt either).

This topic is closed to new replies.

Advertisement