Jump to content
  • Advertisement
Sign in to follow this  
Strange Species

Texture edge problems

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

When using individual alpha maps for a batch of tiles for my terrain, I get a blend-to-black around the edges. I've heard that this is related to the sampling method, and is a common by easily fixed problem. What would I have to do in order to fix it? a) Expand the image by 1 pixel on each side b) Same as (a) but duplicate the bottom and right edge pixels c) Expand the image by 2 pixels, one on each side d) Same as (c) but duplicate all edge pixels e) Same as (c) but get the edge pixels from the nearby tiles f) Something else I already know I'd have to adjust the texture coordinates though. Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Yeh, I thought so too. I have fixed my edge problem with these lines:


    m_lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
    m_lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);


I'm sure that's gonna help you too.

Share this post


Link to post
Share on other sites
Ok, I'll try that. What happens when I have two adjacent tiles with separate alpha maps? It's going to show a visible edge, isn't it (i.e. no blend between them)?

Share this post


Link to post
Share on other sites
Well, at first I suggest you check that you compute the texture coordinates right. Just putting coordinates from 0 to 1 doesn't usually work.

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!