Jump to content
  • Advertisement
Sign in to follow this  
deffer

OpenGL triangles with borders

This topic is 4804 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

Hi. I got my program developed for a while. Lately I got it run on my friend's computer, and it behaved a bit differently than on mine. Specifically, all triangles have black edges. I suppose it is related to default opengl settings difference in another vendor's drivers. Am I right? Is this a normal gl option. How to turn it off? /def

Share this post


Link to post
Share on other sites
Advertisement
Nope, it didn't work.
But it's definitely something with textures, as the problem doesn't show in simple colored-vertices drawing.

Unless there's something else I should combine this with...
?

Share this post


Link to post
Share on other sites
Could you show us a screenshot of this, perhaps? Also some code pertaining to your texture setup might also help lead toward the culprit of this bug. :)

Share this post


Link to post
Share on other sites
The deal is: I'm not setting any texture-related options at all. Only binding buffers, enabling texture stages, and the family calls like:
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB );
glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE );


I will post a screenshot tomorrow, since the problem does not apear on my own machine.

@zedzeek:
What does the GL_CLAMP_TO_EDGE mean exactly? I couldn't find it in sgi's documentation.

Share this post


Link to post
Share on other sites
Quote:
What does the GL_CLAMP_TO_EDGE mean exactly?

goto www.opengl.org and download the opengl2.0 spec
background info
i assume its the borders but cant see without a screenshot
*nvidia drivers used to implement GL_CLAMP wrongly they used the GL_CLAMP_TO_EDGE method instead, they fixing the problem (3-5 years ago)
anyways which led to problems of black borders suddenly appearing(default border color is black) on apps that had (wrongly) used GL_CLAMP happily until then
*a lot of oldish cards eg gf2 dont support texture borders

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
goto www.opengl.org and download the opengl2.0 spec


Ok. I read that.
And it seems to me that it is not the source of the problem. Because the black border appears around all textured triangles. Even those with tex-coords not even near the clamping 0 and 1 values (eg. around 0.5).
And also, I need wrapping. I just use it (altough I could not to, it's not too much work to wrap by hand while initializing data).

I'll post a screenshot today.
/def

Share this post


Link to post
Share on other sites
try using GL_NEAREST instead of GL_LINEAR in your call to glTexParameter*();

note: i might have this backwards, e.g. use linear instead of nearest. Just try it ;)

Share this post


Link to post
Share on other sites
I am facing just the same problem as deffer. I am capturing screen pixels and storing them in a texture using glCopyTexImage2D.

The switch to GL_NEAREST got me rid of the black border but blocky pixelation is now more than obvious. I tried solving this new problem with mipmaps but failed. Do you have any suggestions?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!