Skip to main content
gamedev.net
🔒 Locked

texture distortion

Started by Calin Jul 3, 2006 at 9:16 PM 2 replies 550+ views
Original Post
Calin
Calin
in-game rendering (with artifacts): source texture: Anyone familiar with this type of distortion? I tried various parameters for TextureLoader.FromFile function, without luck though.
My project`s facebook page is “DreamLand Page”
The 89 Vision
The 89 Vision
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.
jollyjeffers
jollyjeffers
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
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Calin
Calin
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!
My project`s facebook page is “DreamLand Page”

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.