Repository navigation
feat(extensions): add WebGPU height-map fitting to TerrainExtension - #10751
Conversation
[Medium impact] The changes reach terrain rendering, shared shader geometry, and picking. Satisfy the repository's TSDoc requirement before merging; no new blocking behavior issue was established. Findings
SummaryAdds WebGPU terrain fitting in
The new shader constants need the documentation required by the repository guide. Reviews (17) · Last reviewed commit: "fix(extensions): register terrain effect..." · Reviewed by Greptile |
59fed01 to
cc81329
Compare
cb26a68 to
fb26e1d
Compare
1c60fbc to
5d509a3
Compare
315383c to
f3a99a8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 f3a99a8. Configure here.
ibgreen
left a comment
There was a problem hiding this comment.
Reviewed the shared Terrain plugin, height pass, and follow-up fixes for implicit offset mode and registering the effect when the extension is added. The final CI run exercised all 46 Terrain browser cases in the standard job. I found no remaining blocker.
Master's GLSL terrain module samples the Mercator height map through the globe inverse for both PROJECTION_MODE_GLOBE and GLOBE_METER_OFFSETS (#10874). Match it in the WGSL plugin so meter-offset layers on GlobeView read and write the height map at the right texels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1c777ca to
b7d618d
Compare
|
|
||
| import {TERRAIN_MODE} from './terrain-mode'; | ||
|
|
||
| export const terrainWGSLSource = /* wgsl */ ` |
There was a problem hiding this comment.
Shader constants lack required docs. The repository guide requires TSDoc for constants, including internal declarations.
terrainWGSLSource has none, as do terrainWGSLVertexInjection and terrainWGSLFragmentInjection. Add short comments explaining what each string supplies; this pattern also appears elsewhere in the additions.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Background
WebGPU terrain offset fitting places layers on a height map. Texture draping remains WebGL-only.
Change List
Verified: build, lint, website, 71 extension tests, nine focused regressions, 26 render comparisons, and 49 node tests.
Note
Medium Risk
Modifies shared shader geometry structures,
SimpleMeshLayerbounding box calculations, and picking blend logic alongside experimental WebGPU terrain pipelines.Overview
Adds WebGPU support to
TerrainExtensionfor height-map fitting usingterrainDrawMode: 'offset'. New WGSL shader modules encode elevation into RGBA8 render targets, sample terrain heights, and reposition vertices in clip space.HeightMapBuilderandTerrainPassare updated on WebGPU to calculate elevation ranges for depth-ordered writes, manage depth-enabled height-map render targets, and configure blending. To preserve billboard sizing and path stroke widths across height adjustments,VertexGeometrynow tracksscreenSpaceOffsetacross GLSL and WGSL shaders.In addition,
SimpleMeshLayer.getBoundsnow accounts for instance transforms to supply accurate mesh elevation ranges, andPickLayersPassupdates picking blend parameters to avoid invalid alpha writes during pure terrain passes.Reviewed by Cursor Bugbot for commit b7d618d. Bugbot is set up for automated code reviews on this repo. Configure here.