Jump to content
  • Advertisement
Sign in to follow this  
JJcorps

problems with glTexParameteri

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
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 this post


Link to post
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!