Repository navigation
refactor(path-layer): separate dash arclength from geometry - #10647
Conversation
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummarySeparates dash distance from PathLayer’s geometric coordinates in GLSL and WGSL.
|
5dd2826 to
9519568
Compare
# Conflicts: # test/render/test-cases/path-dash.spec.ts
…tyle-dash-varyings # Conflicts: # modules/extensions/src/path-style/shaders.glsl.ts # modules/geo-layers/src/trips-layer/trips-layer.ts # modules/geo-layers/src/trips-layer/trips-layer.wgsl.ts # test/modules/extensions/path.spec.ts # test/modules/geo-layers/trips-layer.spec.ts
…tyle-dash-varyings
athomct
left a comment
There was a problem hiding this comment.
I read through both backends and the cap/joint predicate looks equivalent: the dash coordinate is an affine map of the geometric one, and it maps [0, L] exactly onto the old vPathBounds in both billboard and flat modes, so the fragment tests are unchanged. TripsLayer progress is the same ratio as before, and the offset stage scales both components together. The WebGL path, path-layer and trips render suites pass locally on the top of the stack, and the new clipped Trips golden fails if the TripsLayer change is reverted.
Two small suggestions:
geometry.uv.yon a dashed PathLayer changes from dash arclength to geometric distance. The custom-layer docs listDECKGL_FILTER_COLORandgeometryas the public injection surface, so a one-line upgrade-guide note for v10 seems worthwhile, pointing tovDashSegmentfor the dash coordinate.- In
trips-layer.spec.ts, the WGSL check asserts thevDashSegment.xposition argument but not thevDashSegment.ylength argument. Asserting the fullDECKGL_FILTER_PATH_COLOR_VERTEX(...)call would catch a regression tovPathLengththere, which no render test covers on WebGPU.
…ips-dash-baseline
…tyle-dash-varyings
…ment Also assert the full WGSL DECKGL_FILTER_PATH_COLOR_VERTEX call in the TripsLayer dash test.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Follow up of #10646
Background
With dashes on,
vPathPosition.ycarries dash arclength (scaled for Z and camera clipping), so PathLayer's cap and joint tests need a separatevPathBoundsvarying. Moving the dash coordinate to its own varying keepsvPathPositiongeometric in both modes.Change List
PathLayerGLSL/WGSL: replacevPathBoundswithvDashSegment(position, segment length)PathStyleExtension: read dash phase and fit length fromvDashSegmentTripsLayer: compute progress fromvDashSegmentwhen dashes are ongeometry.uv.yis now geometric distance with dashes onvDashSegmentNo golden images changed. Verified with headless unit tests and the WebGL
path-dash,path-layer,polygon-layerandtrips-layerrender suites.Note
Medium Risk
Modifies core vertex and fragment shader varyings across GLSL and WGSL in
PathLayer,PathStyleExtension, andTripsLayer. Any custom shader injections expecting dash arclength invPathPosition.ywill require updating tovDashSegment.Overview
Separates dash arclength coordinates from
PathLayergeometric coordinates across both GLSL and WGSL shaders. Previously, enabling dashes scaledvPathPosition.yandvPathLengthto account for 3D Z-deltas and camera clipping, requiring a separatevPathBoundsvarying to handle cap and joint tests.Replaces
vPathBoundswith a newvDashSegmentvarying carrying the source-segment dash position and length underDASH_ENABLED.vPathPosition,vPathLength, andgeometry.uv.ynow remain purely geometric in both dash and non-dash modes, whilePathStyleExtensionandTripsLayerreadvDashSegmentfor dash rendering and trip progress calculations.Reviewed by Cursor Bugbot for commit d367279. Bugbot is set up for automated code reviews on this repo. Configure here.