   [SOLVED] Anisotropic Filtering
  HiIn my terrain engine, I'm employing a manual method of retrieving the mipmap level of a texture.  I have to do this due to dynamic branching.  The results are fairly good for textures with relatively little colour change across the whole texture but for those with more contrasting colouring, I get a bit of aliasing at distance which isn't really acceptable.  I can tweak my mipmap level making it a bit more aggressive which results in distance textures being more blurred - this is probably worse I think.I've been reading up on anisotropic filtering which looks like it could be the way forward.  Nowadays, is this something that is done by applications (in shaders) or is it generally just switched on in the hardware (via GPU the control panel)?  Are there any good books on this subject or links?  I've read a few but it's difficult to determine what's best to do if the articles are a bit dated.Thanks in advance.[Edited by - RobMaddison on May 13, 2009 2:11:06 AM]
  it's a sample state, just like you set point/nearest filtering, or bilinear/trilinear filtering, you can set anisotropic filtering, that's it, it will automatically work.it's probably faster to try it than to find something to read about it ;);Quote:it will automatically workI like the sound of that.  I'm doing a manual calculation of mipmap level so won't that cause a few issues with the sampling?  Whilst just tinkering, I did try just replacing LINEAR with ANISOTROPIC in my texture sampler definition but nothing changed.  Maybe I missed some extra sampler state you need with AF?My texture sampler definition looks like this:MinFilter = LINEAR;MagFilter = LINEAR;MipFilter = LINEAR;Changing them all to ANISOTROPIC didn't make any difference at all (although I think I read somewhere that MipFilter doesn't support ANISOTROPIC?).Thanks   ;  yeah, mipfilter shall be linear, you might also want to setMaxAnisotropyto maybe 16and also you have to select a mip level that usually leads to aliasing.anisotropic work in the way that it samples several times (like 16) and takes the average to avoid aliasing, but you need to sample from a highlevel that would lead to aliasing.sampling anisotropic from some mip level that is blury with just trilinear will not make any difference.   ;  Thanks, that's really useful.   ;  I've tried various ways of trying to get anisotropic filtering working and I can't seem to get any decent results.  Here's a screenshot.What I'm seeing in area 1 is a huge amount of 'noise' when I move the mouse around.  When there is no movement it doesn't look too bad but to be honest, it still doesn't look any different to when anisotropic filtering is off and isn't really acceptable.  In area 2 on the diagonal, there appears to be minute duplicating which also looks strange.I've tried setting Min and Mag Filters to ANISOTROPIC, setting the MaxAnisotropic value to 16 and I've also tried setting everything anisotropic in the NVidia control panel but I still can't see any improvement.What I also tried, to ensure my mipmap level selection algorithm isn't the cause, is to just use normal tex2D (instead of tex2Dlod).  No difference.Am I missing something?Thanks(p.s. I'm using an approximation of one of Crysis' textures just for testing).   ;  does the driver setting work for other applications/games?   ;  I haven't tried that - good thought. I was also wondering whether this might be something to do with the quality of my mipmaps. I just save my texture with paint .net in dxt1 format with generate mipmaps enabled.  The mipmap chain looks ok in the dds viewer but that's only to my relatively untrained eye.Thanks   ;  using crysis textures for dummy anyway, just take their .dds files directly from the game without converting them on your own. Then you can be sure they have good quality :)   ;  How do you do that?!  I looked for a while in the crysis editor for how to do that but all I've managed is take a screenshot of the ground and cut an area out.  Is there an option somewhere when you pick a material and view its properties?Thanks   