Repository navigation
HDR prep: normalize rendering colors at input boundaries - #11130
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge; the latest change adds the requested regression test without changing rendering code. SummaryThis PR moves color conversion to shared helpers while keeping public colors byte-valued.
Reviews (4) · Last reviewed commit: "test(layers): cover byte typed-array bit..." · Reviewed by Greptile |
| colorToUse = [...clearColor.slice(0, 3), clearColor[3] || 255].map( | ||
| c => c / 255 | ||
| ) as NumberArray4; | ||
| // Retain the legacy zero-alpha fallback while decoding public byte colors. |
Collaborator
There was a problem hiding this comment.
Suggested change
| // Retain the legacy zero-alpha fallback while decoding public byte colors. | |
| // Retain the zero-alpha fallback while decoding public byte colors. |
Do we intend to drop this? If not, I wouldn't call it legacy
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
deck.gl v10 should support HDR colors which requires larger than 1.0 / 255 values.
This prep diff does not change the deck.gl API, it just consolidates the under the hood handling of colors.
Rendering colors use scattered byte conversions. Centralize straightforward input boundaries while preserving public byte colors and attribute storage. Lights pass normalized copies to luma.gl; public light objects remain mutable and byte-valued. Picking IDs retain their encoding. View clear colors retain the legacy zero-alpha fallback.
Change List
Verified: lint; 33 focused browser tests pass across the suite and isolated render-pass rerun. One initial WebGPU timeout passed on rerun.
Note
Low Risk
Low risk refactoring that standardizes color normalization at shader uniform boundaries while preserving public byte-color contracts and picking encodings.
Overview
Refactors color normalization across layer uniforms, render passes, and shader modules by adopting
@luma.gl/shadersutility functions (normalizeByteColor3andnormalizeByteColor4).Replaces manual per-channel division in
BitmapLayertinting,MultiIconLayeroutlines, aggregation layer color ranges, and viewportclearColorhandling. Additionally,LightingEffectnow supplies normalized light colors withuseByteColors: falseto shader uniforms while preserving public byte-valued light instances, andpickingModulenormalizeshighlightColorindependently from byte-encoded picking IDs.Reviewed by Cursor Bugbot for commit 35f80b1. Bugbot is set up for automated code reviews on this repo. Configure here.