Skip to content

Commit 8fb8e23

Browse files
committed
Increase floating point precision
1 parent 8e005de commit 8fb8e23

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/point.vs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const VERTEX_SHADER = `
2-
precision mediump float;
2+
precision highp float;
33

44
uniform sampler2D colorTex;
55
uniform float colorTexRes;
@@ -47,7 +47,7 @@ void main() {
4747
eps = 0.5 / colorTexRes;
4848
float colorLinearIndex = colorIndex + globalState;
4949
// Need to add cEps here to avoid floating point issue that can lead to
50-
// dramatic changes in which color is loaded as floor(3/2.9) = 1 but
50+
// dramatic changes in which color is loaded as floor(3/2.9999) = 1 but
5151
// floor(3/3.0001) = 0!
5252
float colorRowIndex = floor((colorLinearIndex + eps) / colorTexRes);
5353

0 commit comments

Comments
 (0)