Adding reflectivity declutter capability

This commit is contained in:
Dan Paulat 2021-11-14 00:25:17 -06:00
parent e58b1f5b57
commit 77ba92ce7f
7 changed files with 130 additions and 6 deletions

View file

@ -7,7 +7,10 @@ uniform sampler1D uTexture;
uniform uint uDataMomentOffset;
uniform float uDataMomentScale;
uniform bool uCFPEnabled;
flat in uint dataMoment;
flat in uint cfpMoment;
layout (location = 0) out vec4 fragColor;
@ -15,5 +18,10 @@ void main()
{
float texCoord = float(dataMoment - uDataMomentOffset) / uDataMomentScale;
if (uCFPEnabled && cfpMoment > 8u)
{
texCoord = texCoord - float(cfpMoment - 8u) / 2.0f;
}
fragColor = texture(uTexture, texCoord);
}

View file

@ -8,11 +8,13 @@
layout (location = 0) in vec2 aLatLong;
layout (location = 1) in uint aDataMoment;
layout (location = 2) in uint aCfpMoment;
uniform mat4 uMVPMatrix;
uniform vec2 uMapScreenCoord;
flat out uint dataMoment;
flat out uint cfpMoment;
vec2 latLngToScreenCoordinate(in vec2 latLng)
{
@ -27,6 +29,7 @@ void main()
{
// Pass the coded data moment to the fragment shader
dataMoment = aDataMoment;
cfpMoment = aCfpMoment;
vec2 p = latLngToScreenCoordinate(aLatLong) - uMapScreenCoord;