Sign in to follow this  
g0nzo

Downsampling and upsampling an image

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this