# problems with glTexParameteri

This topic is 4745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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.

##### Share on other sites
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).

##### Share on other sites
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).

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5
frob
12

• 9
• 21
• 11
• 9
• 17
• ### Forum Statistics

• Total Topics
632606
• Total Posts
3007383

×