Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Preparing Textures to Reduce Shimmering

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

Hey guys,

 

I was wondering if there are some tried and true methods for preparing textures to reduce shimmering. Even with mipmaps and filtering I get some shimmering, mostly with high contrast textures that are viewed from the side.

 

I'm pretty sure it's the high frequency pixels causing the problem and I can do low pass filtering to minimize it, but all I can think of in Photoshop is either gaussian blur or reduce noise. Maybe there is a better way, or some guidelines to go by.

 

Thanks.

 

Share this post


Link to post
Share on other sites
Advertisement

Are you using generated mipmaps or authored ones? Often, people will alter the mip levels by hand to cut back on shimmering. Also you might try trilinear filtering, if you're using bilinear with mipmaps. That causes the hardware to filter across levels, rather than choosing a level and only filtering within it.

 

After that, there are the extreme answers but they probably don't apply here.

Share this post


Link to post
Share on other sites

Are you talking about shimmering from specular, or from the colors in the texture itself? If it's the former, you should read the link Promit provided and perhaps also check out this thread where we were discussing the same topic. If it's the later, then you can probably address it by prefiltering the mips differently. Filtering out higher frequencies will reduce aliasing, but will also remove high-frequency details from the texture. Certain filter kernels can counteract this somewhat by adding a "sharpening" effect due to their negative lobes.

In theory you really shouldn't get any aliasing from a "standard" mip chain and trilinear filtering, but GPU's tend to play a little loose with their filtering quality in order to boost performance. You can actually adjust manually on some GPU's in the driver control panel. 

Share this post


Link to post
Share on other sites
The way that you generate your mipmaps also has an impact. Standard mipmapping should completely eliminate texture shimmering, at the cost of blurring details. Some art is configure to use a filter other than bilinear durin generation in order to preserve details a bit more.

Share this post


Link to post
Share on other sites

Thanks for the info guys. I'm getting the shimmering from the texture itself. An extreme example would be a texture with a black background and white gridlines. For a texture like that I'd have to drop the levels so the white becomes grey (say 0.5 instead of 1.0) and gaussian blur it, I can also make sure the gridlines aren't too thin. Even after doing that I'd still get some shimmering.

 

I switched to trilinear by doing this:

 

d3d_device->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);
d3d_device->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);
d3d_device->SetSamplerState(0,D3DSAMP_MIPFILTER,D3DTEXF_LINEAR);

 

...and it made a pretty big difference, but some lines still wink in and out a little.
 

I'm making my mips like this:

 

d3d_device->CreateTexture(width,height,0,D3DUSAGE_AUTOGENMIPMAP|D3DUSAGE_DYNAMIC,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&texture,NULL);

texture->GenerateMipSubLevels();

 

Am I on the right track using gaussian blur to prefilter ? Is there another filter that will eliminate only the high frequencies, so it won't blur everything ?

 

Thanks again.

Share this post


Link to post
Share on other sites

Someone correct me if I'm wrong but the auto-generated API function applies a simple box filter (aka just averaging neighboring pixels).

Not sure if I understood it correct but do you generate them using the api call and then try to apply a gaussian filter on them ? Because you shouldn't do that tongue.png

I remember Mitchell (which is a specialized kind of cubic filter afaik) being a fairly good filter for mipmaps.

If you create your textures using photoshop you can set the mip filter using the nvidia dds tool.

 

I also remember Jimenez having a grid sample for his SMAA (Subpixel-Morphological-Anti-Aliasing) solution, so you could look into this kind of AA if nothing else helps.

http://www.iryoku.com/smaa/downloads/SMAA-DX10-v2.8.exe

Edited by lipsryme

Share this post


Link to post
Share on other sites

 

Is there another filter that will eliminate only the high frequencies, so it won't blur everything ?

 

There's also anisotropic filtering, which helps when looking at surfaces from sharp angles.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!