Downsampling rendertexture

I have implemented a gaussian blur shader that I want to optimize by downsampling the rendertexture that I apply the blur shader to and then upsample before rendering to the screen. I have not found any good way of doing this.

You are able to set the size of a render target which gets you up-down sampling when rendering to and from them.

I have tried that and the problem is that I get this result. That blue button is suppose to be in the middle. Seems to be something with the texture coordinates.

Not sure what you’re doing here. Is the image that you render larger than the target texture?

Yes, I’m rendering to a rendertexture that is smaller than the source texture.

Ok, then you need to offset the texture. 0, 0 is in the lower left corner.

Ok I figured it out! Thanks.

1 Like