Jump to content
  • Advertisement
Sign in to follow this  

Downsampling Effect

This topic is 3993 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 performing a down sampling pass for bloom I know you average the closest 16 points or so. My question is this: do you render to a texture that is smaller? Or can you scale the texture in the shader? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Technically speaking the texture doesn't have to be physically smaller, for instance with 2x downsampling you can just render to the upper-left quadrant of an existing texture with the original size. This is what you might do when performing multiple downsampling passes with ping-ponging, you just create two textures that are the original size and only render to increasingly smaller portions of each texture until you get the desired size. However the idea is that you're eliminating samples in each pass.

In both cases you can do the downsampling (averaging, summing, maximizing/minimizing, etc.) in the shader.

Share this post


Link to post
Share on other sites
It's even better if you can get some of that averaging done in the texture samplers. By reading a point inbetween texels, you'll get an average of 4 adjacent texels. You can read from 4 points, and you'll get your 16 averaged colors on SM1.1 cards.

This all breaks down when you have to deal with FP32 render targets, or FP16 targets and ATI hardware. You can determine if the filtering is available and use one of two code paths, or just code for worst case.

Share this post


Link to post
Share on other sites
Alright. Until now I have just been rendering fullscreen quads for each pass. Is this correct? Should I just decrease the size of the quad to render to a smaller portion?

Share this post


Link to post
Share on other sites
Quote:
Original post by Programmer101
Alright. Until now I have just been rendering fullscreen quads for each pass. Is this correct? Should I just decrease the size of the quad to render to a smaller portion?

Sure, or decrease the size of the viewport. I prefer the latter because it's more of a logical change, while modifying vertices is a physical change of geometry data (that could be in a vertex buffer). But that's just me.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!