Jump to content
  • Advertisement
Sign in to follow this  
QNAN

Texture transparancy - problem with non-transparant edge

This topic is 2385 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 am using a texture with an alpha layer as a road. The texture is tiled along the length of the road.
I have problems with the edges, as it seems, that the alpha-values are not properly covering the extreme edges, where they are supposed to.

How do I get around this problem?

Edit: Just for information: I am using Directx 9 and shader 3.0.


texture_edge.jpg Edited by QNAN

Share this post


Link to post
Share on other sites
Advertisement
Texture filtering shenanigans: the texture wraps and thereby it does filtering with the pixels at the other side of the texture.

Quick fix if you want to get this done: edit the texture so if there are transparent pixels at a border, it's also transparent in those same pixels at the other border. One pixel of thickness will do, but beware of mipmaps (since the same rule will need to apply to those, so you may need to add more transparent pixels, depending on how many mipmaps you use). Edited by Sik_the_hedgehog

Share this post


Link to post
Share on other sites
You can also enable border color and make sure it has 0 alpha, which I would consider an easier and possibly more robust solution...

...with the caveat that tiling a texture (as you seem to be doing) becomes nigh-impossible. You can get around this by manually specifying wrap points in the mesh, but it's still a bit on the hacky side.

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!