Repository navigation
fix(geo-layers): draw textured I3S meshes in MeshLayer - #11203
Merged
Merged
Conversation
MeshLayer's fragment shader passed vec4(0) to pbr_filterColor. luma.gl multiplies the base colour by that argument as the glTF vertex colour, so every fragment came out transparent and textured I3S tiles were not drawn. The vertex colour is now passed in, as ScenegraphLayer does. The vertex shader tested HAS_UV_REGIONS with #ifdef, but the layer always defines it, as 1 or 0, so a mesh without uvRegions read the missing attribute and sampled one column of its texture (streaks on I3S integrated meshes). It is tested with #if. Signed-off-by: Javier Andrés García <[email protected]>
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryFixes textured I3S meshes in
No new actionable issues found. Tests were not run during this review. Reviews (4) · Last reviewed commit: "test(geo-layers): check uvRegions offset..." · Reviewed by Greptile |
Texture coordinates of 0.25 and 0.75 over four texels, so the region test tells a mapped coordinate from a constant one. The draw times out and releases the WebGL context, and the new constants carry TSDoc. Signed-off-by: Javier Andrés García <[email protected]>
ibgreen
approved these changes
Nov 19, 2026
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Closes #11202
Background
MeshLayer(the I3S sublayer ofTile3DLayer) passesvec4(0)topbr_filterColor, which luma.gl multiplies into the base colour as the vertex colour, so textured tiles are transparent. On WebGL it also testsHAS_UV_REGIONSwith#ifdefwhile always defining it (0 or 1), so meshes withoutuvRegionssample a single texture column.Change List
MeshLayerfragment shaders (GLSL, WGSL): pass the vertex colour topbr_filterColor, asScenegraphLayerdoesMeshLayervertex shader:#if HAS_UV_REGIONSin place of#ifdefuvRegionsBoth new tests fail on master (nothing drawn; then red over the blue half).
test/modules/geo-layersandtest/modules/mesh-layerspass headless (158 tests), as doocular-lintandtest-fast.Note
Low Risk
Low risk bug fixes to shader macros and color calculations in
MeshLayer, accompanied by WebGL pixel regression tests.Overview
Fixes rendering of textured PBR meshes in
MeshLayerby passing vertex color directly intopbr_filterColoracross GLSL and WGSL fragment shaders, preventing textured tiles from rendering transparently.Additionally, updates the vertex shader preprocessor directive from
#ifdef HAS_UV_REGIONSto#if HAS_UV_REGIONSso meshes without UV regions are not mistakenly treated as having them. New WebGL pixel readback unit tests verify textured mesh rendering with and withoutuvRegions.Reviewed by Cursor Bugbot for commit ffd73cd. Bugbot is set up for automated code reviews on this repo. Configure here.