Jump to content
  • Advertisement
Sign in to follow this  
mlt

Why filtering?

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

When specifying a texture for lookup in either a vertex or fragment program I sometimes read that people apply some filtering so the looked up value is some average of its neighboring texels. But why is that necessary? When using e.g a heightmap as texture why not just use some gaussian smoothing function on the texture before passing it to the shaders?

Share this post


Link to post
Share on other sites
Advertisement
Because pre-filtering is applied at texel resolution, while shader filtering is applied at sub-texel level.

In other words, when you perform filtering in the shader, you can make it dependent on the subtexel position of the current pixel or vertex within the texture. If you don't do that (or have the hardware filters do it for you), your sampled texture will look blocky if it is oversampled or aliased if undersampled (both of which basically happens all the time, unless you have a perfect 1:1 pixel to texel mapping).

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!