PDA

View Full Version : GL_EXT_framebuffer_blit - down-sampling details?



thokra
08-29-2013, 02:01 AM
Hey everyone.

First of all, let me apologize for making an inquiry about such an archaic EXT. ;) It's simply due to work requirements that I not ask about core stuff, no matter how badly I want to.

When up-sampling some read-buffer to a higher-resolution draw-buffer, we can specify linear interpolation to be used as an argument to glBlitFramebuffer - at least that's my interpretation of the condition mentioned in the extension spec:


<filter> must be LINEAR or NEAREST and specifies the method of interpolation to be applied if the image is stretched.

What about down-sampling? Normally we should not concern ourselves with implementation details, but out of specific requirement I'd like to get some insight into the likely scenarios here. Are fragments simply dropped? Is filtering in any way applied? What kind of filters come to mind?

TIA!

Alfonse Reinheart
08-29-2013, 03:37 AM
It is still GL_LINEAR or GL_NEAREST filtering. It works the same way in either direction. NEAREST means that it will compute the pixel coordinate to pull from, and then take the closest actual pixel to the computed coordinate. LINEAR means that it will compute the pixel coordinate to pull from, and linearly interpolate across the 4 nearest pixels to the computed coordinate.

thokra
08-29-2013, 03:47 AM
Duh! pwned by wording - I thought stretching necessarily meant enlarging. Thx Alfonse.