Color radar image using a color table

This commit is contained in:
Dan Paulat 2021-07-29 21:59:21 -05:00
parent f004c7aee0
commit c06230ed6c
6 changed files with 81 additions and 14 deletions

View file

@ -3,7 +3,7 @@
// Lower the default precision to medium
precision mediump float;
uniform sampler2D uTexture;
uniform sampler1D uTexture;
flat in uint dataMoment;
@ -11,16 +11,7 @@ layout (location = 0) out vec4 fragColor;
void main()
{
if (dataMoment < 126u)
{
fragColor = vec4(0.0f, 0.5f, 0.0f, 0.9f);
}
else if (dataMoment < 156u)
{
fragColor = vec4(1.0f, 0.75f, 0.0f, 0.9f);
}
else
{
fragColor = vec4(1.0f, 0.0f, 0.0f, 0.9f);
}
float texCoord = float(dataMoment - 2u) / 253.0f; // TODO: Scale properly
fragColor = texture(uTexture, texCoord);
}