Skip to content

Commit ac8a0ec

Browse files
committed
show depth diff multipled by 1000.0
1 parent 86e3a8d commit ac8a0ec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/depthPrecision/webgl-demo.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ function main() {
4040
} else if (fragCoordX < 0.66) {
4141
gl_FragColor = vec4(vec3(v_depth), 1.0);
4242
} else {
43-
float r = 1.0;
44-
if (gl_FragCoord.z == v_depth) {
45-
r = 0.0;
46-
}
47-
gl_FragColor = vec4(r, 0.0, 0.0, 1.0);
43+
float diff = 1000.0 * abs(gl_FragCoord.z - v_depth);
44+
gl_FragColor = vec4(diff, 0.0, 0.0, 1.0);
4845
}
4946
}
5047
`;

0 commit comments

Comments
 (0)