Skip to content

Commit

Permalink
fix(pointcloud): fix non-world projected elevation
Browse files Browse the repository at this point in the history
  • Loading branch information
Desplandis committed Jun 24, 2024
1 parent 4c98e9e commit 58fc8bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Renderer/Shader/PointsVS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ void main() {
vec2 uv = vec2(i, (1. - i));
vColor = texture2D(gradientTexture, uv);
} else if (mode == PNTS_MODE_ELEVATION) {
float i = (position.z - elevationRange.x) / (elevationRange.y - elevationRange.x);
float z = (modelMatrix * vec4(position, 1.0)).z;
float i = (z - elevationRange.x) / (elevationRange.y - elevationRange.x);
vec2 uv = vec2(i, (1. - i));
vColor = texture2D(gradientTexture, uv);
}
Expand Down

0 comments on commit 58fc8bb

Please sign in to comment.