Skip to content

Instantly share code, notes, and snippets.

@davschne
Created August 23, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davschne/2f93f5debac3b9ebc24750c8e5f12e0e to your computer and use it in GitHub Desktop.
Save davschne/2f93f5debac3b9ebc24750c8e5f12e0e to your computer and use it in GitHub Desktop.
// retrieve and decode pixel value from the old tile
vec4 rgbaFloatsA = texture2D(textureA, vTexCoordA);
float pixelFloatValueA = rgbaToFloat(rgbaFloatsA, littleEndian);
// retrieve and decode pixel value from the new tile
vec4 rgbaFloatsB = texture2D(textureB, vTexCoordB);
float pixelFloatValueB = rgbaToFloat(rgbaFloatsB, littleEndian);
// interpolate
float interpolated = mix(pixelFloatValueA, pixelFloatValueB, interpolationFraction);
// compute the color of the interpolated value
gl_FragColor = computeColor(
interpolated,
colorScale,
sentinelValues,
colorScaleLength,
sentinelValuesLength
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment