Jump to content
  • Advertisement
Sign in to follow this  
Calin

texture distortion

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

in-game rendering (with artifacts): <left> source texture: <left> Anyone familiar with this type of distortion? I tried various parameters for TextureLoader.FromFile function, without luck though.

Share this post


Link to post
Share on other sites
Advertisement
Try changing the texture filtering mode to anisotropic or higher. I'm not sure what language you're using but here's the C++ and C# version.

pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC );

device.SamplerState[0].MagFilter = TextureFilter.Anisotropic;
device.SamplerState[0].MinFilter = TextureFilter.Anisotropic;

Hope that helps.

Share this post


Link to post
Share on other sites
I'm not sure anisotropic filtering will have much benefit until you start rotating the textures around - from those screenshots they're screen-aligned?

I'd go after the texture coordinates myself. I've seen odd effects like you've shown (although with more regularity) when the texture coordinates are evenly slightly off-centre. Most pixels will get sampled correctly, but some will eventually get rounded incorrectly and the wrong pixel gets sampled...

If this is for screen-aligned rendering have you followed the rules shown in the "Directly mapping texels to pixels" article?

hth
Jack

Share this post


Link to post
Share on other sites
It was a texture filtering problem. Setting to Liniar filtering or higher got the artifacts out. I thought the 9th and 10th parameters in texture-from-file function get you same result as SetSamplerState. So I haven't tried the SetSamplerState function.

Thanks for help!

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!