Hi,

I need to implement a demosaic/debayer algorithm in a fragment shader.
The bayer masked image is given as a texture to the shader.
I have the need to know if my current fragment position is on an odd or
even position.
However, the texture position (s,t) is given in float values 0.0-1.0.
Converting the values to ints by using a float unit of my dimension is
ambiguous due to the float resolution:
float yUnit = 1/texHight;
float currentY = gl_TexCoord[0].t * yUnit;
There is no guarantee currentY will have a zero exponent. (i.e X.00),
and even if the exponent is 0, its not nesseseraly correct.

So my questions are:
1. As far as I know there is no concept of "static" in GLSL. - is this
true?
If it is, is there a way to have a value stored from one fragment
iteration to the next?
This could solve my problem, since I could just keep a counter to
know on which Y line I am on.
2. Any other suggestions on how to deal with this problem is more then
welcome.

Thanks!