awips2/cave/com.raytheon.viz.core.gl/localization/glsl/mosaicMaxVal.glsl
Steve Harris 61f269f54c 12.9.1-5 baseline
Former-commit-id: d85b989f77196d20eb2d2a21cf4daa13d50474ae
2012-08-21 15:27:03 -05:00

19 lines
No EOL
550 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))));
if ( imageVal.r > curVal.r ) {
gl_FragColor = vec4(imageVal.r,0.0,0.0,1.0);
} else {
gl_FragColor = vec4(curVal.r,0.0,0.0,1.0);
}
}