# Question about mipmaps + anisotropic filtering

I'm a bit confused here and maybe someone can explain this to me. I created a simple test texture for my terrain which is nothing more than a solid green color with a black grid overlayed on top of it. If I look at the terrain in the distance with mipmapping on and linear filtering, the grid lines become blurry fairly quickly and further back the grid is pretty much invisible. With these settings, I don't get any moire patterns at all. If I turn on anisotropic filtering, however, the higher the anisotropic level, the more the terrain looks like it did with without mipmapping. The lines are much crisper nearby but in the distance I start to see terrible moire patterns.

My understanding was that mipmapping is supposed to get rid of moire patterns. I've always had anisotropic filtering on in every game I play and I've never noticed any moire patterns as a result, so I don't understand why it's happening in my game. I am using logarithmic depth however, could that be causing any problems? And if it is, how do I resolve it?

I've created my sampler state like so (I'm using slimdx):

ssa = SamplerState.FromDescription(Engine.Device, new SamplerDescription
{
Filter = Filter.Anisotropic,
MaximumAnisotropy = anisotropicLevel,
MinimumLod = 0,
MaximumLod = float.MaxValue
});


Point Filtering

Anisotropic 1

Anisotropic 8

Anisotropic 16

Anisotropic 16 at an angle

• Could you post a screenshot of the patterns you get with anisotropic filtering on? Jun 8, 2012 at 5:32
• @NathanReed Done Jun 8, 2012 at 5:43
• Thanks. Interesting pictures. I'm not completely sure what's going on, but I wonder if hardware aniso simply doesn't work well with a texture like this. Aniso is, after all, just another approximation, like mipmaps. I wonder if something like EWA would fare better? Jun 8, 2012 at 6:12
• Would the fact that I'm using a texture atlas cause this? Jun 8, 2012 at 7:12
• As in, the green square is only a sub-rectangle within a larger image? Yeah, I could definitely see that causing issues - mipmapping in general doesn't work well with texture atlases. Jun 8, 2012 at 16:23