Author Topic: GLSL shader: how to "downsample" an image?  (Read 119 times)


  • Sr. Member
  • ****
  • Posts: 201
    • View Profile
GLSL shader: how to "downsample" an image?
« on: September 03, 2018, 12:31:46 AM »
Some filters (like blur filters ;) ) work best with a reduced texture size, for example a gaussian blur on a 128x128 pixel image can be smoother with few semples, while the same gaussian blur on a 512 x 512 pixel image requires a lot of samples. In AM I use this trick of adding the 512x512 image on a 128x128 surface, then apply the shader on the surface and rescale it to the desired size.

I'm quite sure that there's a way to write a GLSL shader (vertex?) that downsamples the image before rasterizing it, but I cant' find it, except the use of mipmaps that is so good but doesn't work on my mac :D

Any idea?