Jump to content
  • Advertisement
Sign in to follow this  
CTPAX

GL_CLAMP_TO_EDGE problem

This topic is 3429 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 having problem with figuring it out. I'm using in this example 4 quads that are connected and I'm using one tile texture. I used GL_CLAMP before, then switched to GL_CLAMP_TO_EDGE and the other problem appeared. The pixels on border doesn't fit in with pixels with other pixels in the quad that is near it. I've tried with couple of versions of glext.h, none worked. I've read numerous threads about solving this problem and what I found in them that this won't solve problem. Is that wrong, how can I use tiles differently, since I'd like to use them to make a terrain map. This is a picture of this problem: http://i437.photobucket.com/albums/qq91/CTPAX216/slika.png

Share this post


Link to post
Share on other sites
Advertisement
Why dont you render 1 large quad and repeat the texture over it 4 times?

Share this post


Link to post
Share on other sites
I see my example is little bit confusing. I want to make a terrain, so I'll use small quads with different textures. I've used only one here to see that they don't fit in, but I've got some textures ready that mixes different kind of terrain(grass with mud) so the terrain can get it's final look.

Share this post


Link to post
Share on other sites
Is there anyone who know solution to this? Or is it too trivial task to explain? I think it's not trivial, I need your help to solve it.

Share this post


Link to post
Share on other sites
You haven't made clear what the issue is but I'm sure it has nothing to do with
GL_CLAMP_TO_EDGE. For all I know, the problem is the artwork itself that doesn't tile well.

Share this post


Link to post
Share on other sites
It's not problem with artwork... I've tried a couple of them.. If you do picture offset in Photoshop you should be able to see if the picture can not be tiled. I've read somewhere that there's problem with GL_CLAMP_TO_EDGE and Mipmaps, but there's problem with plain linear filtering, and what I read didn't make much sense... I guess nobody here can answer me this...

Share this post


Link to post
Share on other sites
Quote:
Original post by CTPAX
I guess nobody here can answer me this...

I would, but my reply would be on an outdated method which probably has a better alternative already. The problem you have is that the last texel in one texture doesn't get filtered with the first texel of the next texture - so the former gets extended and then the latter appears sudden of all, without any blending at all.

I wonder if that helps at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sik_the_hedgehog
Quote:
Original post by CTPAX
I guess nobody here can answer me this...

I would, but my reply would be on an outdated method which probably has a better alternative already. The problem you have is that the last texel in one texture doesn't get filtered with the first texel of the next texture - so the former gets extended and then the latter appears sudden of all, without any blending at all.

I wonder if that helps at all.

That is my guess as well. For the two tiles next to each other to blend seamlessly, the filtering in the borders needs access to the texels from the neighboring tiles to blend with. Can be solved by replicating the tile data from adjacent tiles into other tiles. For example, if a tile is 32x32 texels, make it 34x34, where the outer border corresponds to the texel values of the neighboring tiles. Texture coordinates can then select the center 32x32 tile, while keeping filtering proper in the border case.

Share this post


Link to post
Share on other sites
Thanks for the reply, guys, but it didn't help.. It's updated method of course, if you have a better way, please help me... GL_CLAMP_TO_EDGe is version 1.3 I think...

Share this post


Link to post
Share on other sites
Maybe I'm missing something here, but why don't you just use GL_REPEAT? That would blend the edges with the opposite sides.

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!