Jump to content
  • Advertisement
Sign in to follow this  
Quat

Downsampling Question d3d11

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

I am doing some post processing and want to downsample my current render target. For a texture that has even dimensions, doing a 2x2 downsample is very easy. For example, 2x2->1x1, when the 1x1 pixel is drawn the interpolated texture coordinates will be (0.5, 0.5), which will blinearly interpolate the 2x2 texels nicely.

For 3x3-->1x1, when the 1x1 pixel is drawn the interpolated texture coordinates will be (0.5, 0.5), which coincides exactly with the center texel, so no filtering will be done and I am basically throwing away info.

My application can be in windowed mode, so it is possible for the render target width or height to be odd.

I'm wondering what the best way to handle this is? Should I first stretch my image to the closest and smallest power of 2, then down sample from there? Or should I mix kernels between even/odd passes? The main thing I don't like about making a special 3x3-->1x1 kernel filter is that it then becomes 4X more expensive for downsampling an odd sized image.

Share this post


Link to post
Share on other sites
Advertisement
Hi Quat!

Would the GenerateMips method be an option for you?
It should handle all cases robustly and you could directly load (thereby by-passing the filtering) when you read from the mip level during your post-processing.

Best regards!

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!