anisotropic filtering

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
winder
Halfling
Posts: 81
Joined: Mon Nov 26, 2007 4:36 pm

anisotropic filtering

Post by winder »

i'm using ogremax to load a scene. When camera "sees" objects in small angle the textures (jpg) are very blurry... so i think i must use anisotropic filtering.

i add this to my code... it compiles corectly, but nothing changes ingame. Is there anything else i must do?

Code: Select all

MaterialManager::getSingleton().setDefaultTextureFiltering(TFO_ANISOTROPIC);
MaterialManager::getSingleton().setDefaultAnisotropy(8);
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

This could be the fact that JPEGs can introduce a lot of artifacts or, more commonly, the mip-maps that are generated are poor and it's making it blurry. Take a screenshot of before and after turning anisotropic filtering on for comparison and post them here. Also try exporting your texture as a DDS or PNG - the DDS format can hold mip-map data and PNGs don't lose much (or any, if you use a loss-less format) quality, but have no mip-maps until run-time.
winder
Halfling
Posts: 81
Joined: Mon Nov 26, 2007 4:36 pm

Post by winder »

this is with af on. The exact same screenshot is with no af. (like nothing is happening).

Image
winder
Halfling
Posts: 81
Joined: Mon Nov 26, 2007 4:36 pm

Post by winder »

ok i found out that in my material script there was these two lines....

Code: Select all

filtering trilinear
max_anisotropy 1
i changed them to

Code: Select all

filtering anisotropic
max_anisotropy 8
and here it is :)

Image