awips2/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicOrdered.glsl
Steve Harris 2d928d328e 12.9.1-5 baseline
Former-commit-id: a1d931fd44 [formerly 61f269f54c] [formerly a1d931fd44 [formerly 61f269f54c] [formerly f2fac39428 [formerly d85b989f77196d20eb2d2a21cf4daa13d50474ae]]]
Former-commit-id: f2fac39428
Former-commit-id: 7fb0b17bd5 [formerly 72824561cb]
Former-commit-id: 9b5c2094ed
2012-08-21 15:27:03 -05:00

20 lines
No EOL
661 B
GLSL

// this shader program sets values into a mosaic texture
// which is the same size as the screen (frame buffer)
uniform sampler2D imageData;
uniform sampler2D mosaicTexture;
uniform int height;
uniform int width;
void main(void)
{
vec2 xy = gl_FragCoord.xy;
vec4 imageVal = texture2D(imageData,gl_TexCoord[0].st);
vec4 curVal = texture2D(mosaicTexture, vec2((xy.x / float(width)), (xy.y / float(height))));
// assume 0 or NaN is No Data and should be replaced if another image has better values.
if ( imageVal.r != 0 && imageVal.r == imageVal.r) {
gl_FragColor = vec4(imageVal.r,0.0,0.0,1.0);
} else {
gl_FragColor = vec4(curVal.r,0.0,0.0,1.0);
}
}