Jump to content
  • Advertisement
Sign in to follow this  
mlt

Why filtering?

This topic is 3668 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.

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!