Skip to content

feat(geo-layers): honor normalized terrain and 3D tile colors - #11166

Merged
ibgreen merged 3 commits into
masterfrom
codex/normalized-tiled-colors
Nov 18, 2026
Merged

ibgreen merged 3 commits into
masterfrom
codex/normalized-tiled-colors

Conversation

@ibgreen

@ibgreen ibgreen commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

For #11146. Pack application-supplied TerrainLayer and Tile3DLayer plain-array colors at the byte-encoded sublayer boundary. Preserve tile-supplied colors and built-in defaults. Cached Tile3DLayer sublayers refresh when the Deck option changes.

Validation

  • yarn lint
  • Focused headless Tile3DLayer regression tests
  • Commit hook Node suite (203 tests)

Note

Low Risk
Low risk change that transforms normalized color inputs to byte values across sublayer boundaries without altering core data-loading or tile-processing logic.

Overview
Converts application-supplied normalized colors (0–1 range) to byte colors (0–255) at the sublayer boundary for TerrainLayer and Tile3DLayer. This ensures that fallback terrain colors, point cloud colors (getPointColor), and mesh colors (_getMeshColor) properly honor deck.gl's normalizedColors mode while preserving tile-supplied data and default values.

Tile3DLayer and TerrainLayer also track changes to normalizedColors in update triggers, invalidating and re-rendering cached sublayers whenever the normalization setting toggles.

Reviewed by Cursor Bugbot for commit 861bb9a. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:05:22.158575Z bcb4027 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibgreen ibgreen mentioned this pull request Nov 17, 2026
22 of 52 tasks

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcb40271bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge.

Summary

Adds support for normalized application colors in terrain and 3D tiles while preserving built-in defaults and tile-provided colors.

  • Terrain meshes receive byte colors when normalized mode is on.
  • 3D tiles use byte colors for normalized application color inputs.

No new actionable issues found. The earlier color-refresh and helper-comment findings are addressed.

Reviews (3) · Last reviewed commit: "fix(geo-layers): type byte defaults and ..." · Reviewed by Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bcb4027. Configure here.

@coveralls

Copy link
Copy Markdown

Coverage Status

No base build to compare — codex/normalized-tiled-colors into master

@ibgreen
ibgreen merged commit 01fd343 into master Nov 18, 2026
9 checks passed
@ibgreen
ibgreen deleted the codex/normalized-tiled-colors branch November 18, 2026 00:04

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 861bb9a after merge; follow-ups below. One P1 in the docs, outside the diff. Terrain and Tile3D colors are converted once at the sublayer boundary, and the toggle fixes from the earlier threads hold on master.

P1: docs/api-reference/geo-layers/tile-3d-layer.md still says getPointColor components are "in the 0-255 range" (line 288) and _getMeshColor returns values "in the 0-255 range" (line 320). The guide in using-layers.md#normalized-colors lists both as following normalizedColors. Could we qualify both entries with a link to that section?

Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.


Generated by Claude Code

Comment on lines +51 to +73
test('Tile3DLayer converts normalized mesh colors at the sublayer boundary', () => {
const layer = new Tile3DLayer({_getMeshColor: () => [1, 0.5, 0]});
layer.context = {normalizedColors: true} as typeof layer.context;
const tileHeader = {
id: 'normalized-mesh-tile',
type: TILE_TYPE.MESH,
content: {
attributes: {positions: {value: new Float32Array([0, 0, 0]), size: 3}},
indices: {value: new Uint16Array([0]), size: 1},
cartographicOrigin: [0, 0, 0],
coordinateSystem: 'lnglat'
}
};

// @ts-expect-error Calling the private sublayer factory for test-only validation.
const normalized = layer._makeSimpleMeshLayer(tileHeader);
expect(normalized.props.getColor).toEqual([255, 128, 0, 255]);

layer.context.normalizedColors = false;
// @ts-expect-error Calling the private sublayer factory for test-only validation.
const legacy = layer._makeSimpleMeshLayer(tileHeader);
expect(legacy.props.getColor).toEqual([1, 0.5, 0]);
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This covers mesh colors only. The point-cloud toggle fix from the earlier thread and the TerrainLayer fallback color have no test, so a regression in either still passes CI.

Could we add a point-cloud case that toggles normalizedColors with a function getPointColor?


Generated by Claude Code

import {type Color, _packNormalizedColor as packNormalizedColor} from '@deck.gl/core';

/** Pack normalized plain arrays into bytes and pass through typed array inputs. */
export function toByteColor(color: Color): Color {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: This is the third copy of toByteColor (also in aggregation-layers and fill-style). CompositeLayer.getSubLayerColorAccessor from #11160 already packs constants and accessor results. Could these layers use it?


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants