awips2/cave/com.raytheon.uf.viz.radar.gl/localization/glsl/mosaicMaxVal.glsl
root a02aeb236c Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]
Former-commit-id: 9f19e3f712
2012-01-06 08:55:05 -06:00

19 lines
No EOL
536 B
GLSL

// this shader program sets values into a mosaic texture
// which is the same size as the screen (frame buffer)
uniform sampler2D radarData;
uniform sampler2D mosaicTexture;
uniform int height;
uniform int width;
void main(void)
{
vec2 xy = gl_FragCoord.xy;
vec4 radarVal = texture2D(radarData,gl_TexCoord[0].st);
vec4 curVal = texture2D(mosaicTexture, vec2((xy.x / width), (xy.y / height)));
if ( radarVal.r > curVal.r ) {
gl_FragColor = vec4(radarVal.r,0.0,0.0,1.0);
} else {
gl_FragColor = vec4(curVal.r,0.0,0.0,1.0);
}
}