Jump to content
  • Advertisement
Sign in to follow this  
g0nzo

Downsampling and upsampling an image

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

Hi, I'm trying to implement an algorithm that requires downsampling and upsampling with different scaling factor. Till now I was using shaders for it because I had to store some additional information during downsampling. But now I just need to downsample/upsample a single channel texture. Can I just render the image to smaller/bigger render target and it will be filtered correctly? Or do I have to use shaders for it?

Share this post


Link to post
Share on other sites
Advertisement
If you render from one texture to another with a bilinear (or better) min- or mag-filter installed on the sampler, then it will take care of all the scaling for you, whether your scaling factor is 1.0 or 1000000.0, uniform or non-uniform, affine-direct or otherwise. It is your responsibility, though, to make sure that the render-target has the right dimensions.
Often, shaders are used for convenience or performance, but to simply scale every channel of an image, rendering to a (pseudo) quad in the FFP works marvellously.

Regards
Admiral

Share this post


Link to post
Share on other sites
Thanks!

I'll use FFP just for now and later probably move to shaders. My app gets a little to complicated for me, so I just wanted to make this stage as simple as possible and just make it work.

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!