Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: irrelevant X, Y, Z readout for map layer #1731

Merged
merged 8 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code comment fixes
  • Loading branch information
nilscb committed Oct 23, 2023
commit 664288ebe6c150dc8526dd329c78730184feca1d
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ export default class Grid3DLayer extends CompositeLayer<Grid3DLayerProps> {
oldProps: Grid3DLayerProps;
}): void {
const needs_reload =
!isEqual(props.pointsData, oldProps.pointsData) ||
!isEqual(props.polysData, oldProps.polysData) ||
!isEqual(props.propertiesData, oldProps.propertiesData) ||
!isEqual(props.gridLines, oldProps.gridLines) ||
!isEqual(props.ZIncreasingDownwards, oldProps.ZIncreasingDownwards);
props.pointsData !== oldProps.pointsData ||
props.polysData !== oldProps.polysData ||
props.propertiesData !== oldProps.propertiesData ||
props.gridLines !== oldProps.gridLines ||
props.ZIncreasingDownwards !== oldProps.ZIncreasingDownwards;
if (needs_reload) {
this.setState({
...this.state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ const fs = `vec4 encodeVertexIndexToRGB (int vertexIndex) {
float g = 0.0;
float b = 0.0;

int idx = vertexIndex;

if (idx >= (256 * 256) - 1) {
r = floor(float(idx) / (256.0 * 256.0));
idx -= int(r * (256.0 * 256.0));
if (vertexIndex >= (256 * 256) - 1) {
r = floor(float(vertexIndex) / (256.0 * 256.0));
vertexIndex -= int(r * (256.0 * 256.0));
}

if (idx >= 256 - 1) {
g = floor(float(idx) / 256.0);
idx -= int(g * 256.0);
if (vertexIndex >= 256 - 1) {
g = floor(float(vertexIndex) / 256.0);
vertexIndex -= int(g * 256.0);
}

b = float(idx);
b = float(vertexIndex);

return vec4(r / 255.0, g / 255.0, b / 255.0, 1.0);
}
Expand Down