Skip to content

fix: In RasterTileLayer, allow renderTile to return null to avoid rendering a layer - #489

Merged
kylebarron merged 3 commits into
mainfrom
kyle/allow-render-tile-result-null
Apr 29, 2026
Merged

kylebarron merged 3 commits into
mainfrom
kyle/allow-render-tile-result-null

Conversation

@kylebarron

@kylebarron kylebarron commented Apr 29, 2026 •

Copy link
Copy Markdown
Member

@kylebarron kylebarron changed the title Kyle/allow render tile result null fix: In RasterTileLayer, allow renderTile to return null to avoid rendering a layer Apr 29, 2026
@github-actions github-actions Bot added the fix label Apr 29, 2026
@kylebarron
kylebarron merged commit 9f731b3 into main Apr 29, 2026
4 checks passed
@kylebarron
kylebarron deleted the kyle/allow-render-tile-result-null branch April 29, 2026 19:30
kylebarron added a commit that referenced this pull request May 6, 2026
* docs: add design for NLCD category-filter example

Captures the agreed approach for adding a category-filter UI to the
land-cover example, including the switch to r8uint upload and three
example-local shader modules wired via custom getTileData/renderTile.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* refactor(land-cover): extract NLCD legend data into shared module

Move the NLCD category list out of Legend.tsx so the upcoming
CategoryFilter UI and colormap-texture builder can share a single
source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): add integer-aware shader modules

Three example-local shader modules for the upcoming category-filter
pipeline:

- CreateTextureUint samples an r8uint source via usampler2D and
  introduces an `ivec4 icolor` function-local for downstream modules.
- FilterCategory discards via a 256-byte LUT texture indexed by
  icolor.r.
- PaletteColormap maps icolor.r to RGBA via texelFetch into a 256x1
  colormap texture and writes it to color.

The framework macro signature is unchanged. Integer pixel data flows
between modules through a function-local `ivec4 icolor` declared by
the producer module and consumed by the rest. luma.gl concatenates all
fs:DECKGL_FILTER_COLOR injections into one function body, so the
declaration is in scope for every subsequent injection. A future,
typed shader-module abstraction can supersede this convention; tracked
in the spec as an open follow-up.

Adds @luma.gl/shadertools as a dependency of the example.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): add colormap and filter-LUT texture builders

Pure helpers for constructing the two textures the integer-aware
pipeline expects: a 256x1 RGBA colormap (alpha=0 at nodata, via
parseColormap) and a 256x1 r8 boolean LUT for the active category
selection.

Adds @developmentseed/geotiff as a direct dependency of the example
for parseColormap.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): add custom getTileData and renderTile callbacks

getTileData uploads tiles as r8uint instead of the inferred r8unorm.
makeRenderTile composes the integer-aware shader pipeline once the
colormap and filter-LUT textures are available; until then it returns
null so the layer renders nothing.

Adds @developmentseed/deck.gl-raster as a direct dependency of the
example for the RenderTileResult type.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): add CategoryFilter UI component

Controlled checkbox tree mirroring the existing legend's grouping. Each
heading toggles every leaf beneath it and renders indeterminate when
its leaves are partially selected.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): wire integer-aware pipeline and category filter UI

App captures the luma.gl Device on first tile load, builds the
colormap texture once the GeoTIFF metadata is parsed, and rebuilds
the filter LUT texture whenever the user changes the category
selection. CategoryFilter replaces the read-only Legend.

Also widens COGLayer's user-facing renderTile prop type to allow
returning null, matching the underlying RasterTileLayer capability
added in #489.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): add master toggle and per-heading collapse

- "All categories" master checkbox toggles every leaf, with the
  indeterminate state (the "minus" box) shown when partial.
- Each heading is independently expandable/collapsible so the panel
  stays compact while the user drills into specific groups.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(land-cover): discard nodata fragments in PaletteColormap

The colormap entry for the nodata index already has alpha=0 (set by
parseColormap). Convert that signal into an explicit discard so the
fragment is skipped entirely rather than relying on alpha-blended-to-
zero, which would still pollute the depth buffer and consume blend
bandwidth for invisible pixels.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* reword

* feat(land-cover): link to USGS Annual NLCD data source in info panel

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* set to higher max requests from source.coop

* Swap back to direct s3 url

* refactor(land-cover): use onDeviceInitialized to capture luma.gl Device

Replaces the getTileData wrapper that captured the Device on first
tile load with the cleaner onDeviceInitialized callback on
DeckGLOverlay, matching the pattern used in dynamical-zarr-ecmwf and
naip-mosaic. Drops the customGetTileData useCallback entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* nits

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant