Threaded View

Pixel Corruption From Neighboring Pixels with gl_FragCoord

I'm trying to create a color filter array demosaicing fragment shader for raw capture from a color camera with color bayer filter. In order to properly decode the image, I require acces to clean neighboring texels without any averaging from neighboring texels. Since I'm not using TEXTURE_RECTANGLE textures, I'm a little nervous. I also have to know the exact x/y offset of the main pixel in the shader.

Here is a partial simple shader that implements the RGB values from a red pixel of the color bayer filter array:

1) How do I implement the layout qualifier "pixel_center_integer" with this version of OpenGL? I need the offsets to be the actual integer values, not with 0.5 offsets.

2) Will my greenOffset[] and blueOffset[] texel offsets return me the original buffer pixels without any sub-pixel neighbor averaging? The color demosaicing will not work if the pixel values are in any way mixed.