awips2/cave/com.raytheon.uf.viz.radar.gl/localization/glsl/mosaicMaxVal.glsl
Ben Steffensmeier eb9062a016 Issue #21 update offscreen rendering to work correctly with graphics cards that do not support luminance.
Change-Id: Id04fc4cd643840ddcf39d617d4594def9f013917

Former-commit-id: 53fc5959effe94c2775627a3cd88a5c0287c22d3
2012-01-27 11:50:16 -06: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 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 / float(width)), (xy.y / float(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);
}
}