Adding custom offset and scaling for color table to fragment shader

This commit is contained in:
Dan Paulat 2021-11-13 01:50:44 -06:00
parent 3e92847901
commit aa48d8610a
6 changed files with 60 additions and 14 deletions

View file

@ -4,6 +4,8 @@
precision mediump float;
uniform sampler1D uTexture;
uniform uint uDataMomentOffset;
uniform float uDataMomentScale;
flat in uint dataMoment;
@ -11,7 +13,7 @@ layout (location = 0) out vec4 fragColor;
void main()
{
float texCoord = float(dataMoment - 2u) / 253.0f; // TODO: Scale properly
float texCoord = float(dataMoment - uDataMomentOffset) / uDataMomentScale;
fragColor = texture(uTexture, texCoord);
}