Jump to content

  • Log In with Google      Sign In   
  • Create Account

Strange Borders


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 VanKurt   Members   -  Reputation: 133

Like
Likes
Like

Posted 02 October 2001 - 10:30 PM

Hi folks ! I''ve got something strange going on..... My terrain is made up of tiles (16*16 Vertices, TriangleStrips). Each of these tiles has got it''s own texture, what looks very good, BUT: Around each texture tile, there is a thin border (width 1 pixel), that has only one color (this color seems to be mixed out of all colors in the texture). If I put together these texture-tiles in Photoshop, there is NO border, so I''m shure that OpenGL is screwing something up.... Has anyone an idea, how I can solve this prob ??? Thanks, VanKurt

Sponsor:

#2 DrSmiley   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 11:02 PM

If it''s what I think it is, this is OpenGL''s way of making the texture tile-able.

I.e. when you are trying to have a texture, of size 1x1, cover an area 4x4, OpenGL can be set to automatically blend this edge texel so that when the texture is "repeated" there is no noticeable edge (or at least not quite as visible without it). I guess if your texture is already made in this way, this feature might be inconsequential.

What you''ll be using is GL_REPEAT -
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );

What you want is GL_CLAMP -
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );

Though this has the problem that when specifying texture coordinates, you can only use values between 0 and 1 or it continues the edge texel off to whenever...

Hope this is what you mean.

#3 DrSmiley   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 11:04 PM

Then again, I just re-read your post and think I got totally the wrong idea... whoops

#4 VanKurt   Members   -  Reputation: 133

Like
Likes
Like

Posted 03 October 2001 - 03:39 AM

Hey, where are you OpenGL-Wizzard-Gurus ? ;-)

Perhaps there is something wrong with my openGL texture-settings...?

#5 Scarab0   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 October 2001 - 05:28 AM

Is this the problem (+solution) you are having? (Text from ATI''s page: http://www.ati.com/na/pages/resource_centre/dev_rel/sdk/rage128sdk/OpenGL/EXT_texture_edge_clamp.html )

OpenGL® Extension: EXT_texture_edge_clamp
Many game developers using OpenGL® are surprised to learn that when using GL_CLAMP with any form of bilinear texture filtering, any bilinear fetches that fall outside of the range of 0.0 to 1.0 cause the border color to participate in the bilinear filter. The EXT_texture_edge_clamp extension causes bilinear fetches outside of this range to be ignored (identical to Direct3D''s clamping behavior).

Essentially, using this extension (after confirming it is supported with a call to glGetString(GL_EXTENSIONS)) is as simple as passing CLAMP_TO_EDGE to TexParameterx().

For complete details on this extension, please refer to the official EXT_texture_edge_clamp specification.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS