Repository navigation
feat(layers): add PointCloudLayer analytic antialiasing - #10560
chrisgervang merged 9 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 7935652. Configure here.
7935652 to
ac6af67
Compare
ac6af67 to
3210fb9
Compare
3210fb9 to
5614c83
Compare
5614c83 to
7e97c8f
Compare
ibgreen
left a comment
There was a problem hiding this comment.
This is the lightest default-off regression in the stack because distToCenter already existed, but the disabled shader still gains a runtime uniform branch, an initialized edgePixels, a more complex discard predicate, and the enabled derivative path remains in the compiled pipeline. That falls short of a zero-cost opt-out even though pixels remain unchanged.
For consistency with the other primitive layers, could antialiasing select an AA-on/off shader variant on the CPU instead of being a fragment uniform? The default variant can retain the original hard-discard shader exactly, while changing the prop pays the one-time model/pipeline recreation cost.
7e97c8f to
2dd49a8
Compare
|
Addressed in 2dd49a8. PointCloudLayer now selects compile-time GLSL/WGSL variants and recreates its model on an antialiasing transition. The default variant retains the original hard-discard shader with no AA uniform, derivative, coverage envelope, or extra discard branch. Focused source and lifecycle tests cover both variants. |
4d75e0f to
74d9544
Compare
5b81a04 to
77e6a45
Compare
Greptile SummaryThe PR adds opt-in analytic antialiasing for PointCloudLayer while retaining the existing hard-edge shader path by default.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| modules/layers/src/point-cloud-layer/point-cloud-layer.ts | Adds the antialiasing property, selects the shader define, and follows the established model-recreation lifecycle when toggled. |
| modules/layers/src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts | Expands enabled point geometry by a device-pixel coverage envelope while preserving the default shader path. |
| modules/layers/src/point-cloud-layer/point-cloud-layer-fragment.glsl.ts | Adds derivative-scaled alpha coverage when enabled and retains hard discard when disabled. |
| modules/layers/src/point-cloud-layer/point-cloud-layer.wgsl.ts | Implements the corresponding WebGPU geometry expansion and coverage behavior with premultiplication applied afterward. |
| test/render/test-cases/point-cloud-layer.spec.ts | Adds isolated no-MSAA WebGL coverage, cross-backend golden rendering, and WebGPU premultiplication validation. |
| test/modules/layers/point-cloud-layer.spec.ts | Verifies shader specialization, default fast-path preservation, and model recreation when antialiasing is enabled. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PointCloudLayer antialiasing prop] --> B{Enabled?}
B -- No --> C[Compile default shader variant]
C --> D[Discard fragments outside circle]
B -- Yes --> E[Compile analytic AA variant]
E --> F[Expand enclosing triangle]
F --> G[Compute derivative-scaled edge coverage]
G --> H[Apply coverage to alpha]
Reviews (18): Last reviewed commit: "refactor(point-cloud-layer): use named W..." | Re-trigger Greptile
77e6a45 to
3761fca
Compare
3761fca to
8d00a55
Compare
9388d19 to
9e59512
Compare
9e59512 to
a982aaa
Compare
a982aaa to
16388e1
Compare
16388e1 to
11e8cce
Compare
15667d7 to
b4a59d7
Compare
e24a0fc to
455ff42
Compare
455ff42 to
813a1ad
Compare

Goal
Add opt-in analytic antialiasing to PointCloudLayer's circular point silhouette.
Change List
PointCloudLayer.antialiasing, defaulting tofalse.Validation
yarn lintandyarn buildPerformance benchmark
Extends
yarn bench-antialiasingwith 100K sparse 2px PointCloudLayer points. On an Apple M1 Max running macOS 26.3 in headless Chrome 151.0.7922.138, the median of 100 alternating GPU timestamp samples was 2.688→2.865 ms (+7%) on WebGL2 and 1.518→1.565 ms (+3%) on WebGPU.Visual comparison
The render-test device has framebuffer MSAA disabled. Left:
antialiasing: false. Right:antialiasing: true.Note
Medium Risk
Touches PointCloudLayer vertex/fragment shaders on WebGL and WebGPU, which can change edge coverage and overlap blending. Default remains off, so existing renders are unaffected unless the prop is enabled.
Overview
Adds opt-in
antialiasingonPointCloudLayer(defaultfalse) so circular point silhouettes can be feathered in the shader instead of relying on framebuffer MSAA.When enabled, GLSL and WGSL expand the enclosing triangle by a device-pixel envelope and replace the hard
distToCenter > 1discard with a derivative-scaledsmoothedgealpha ramp. The default path is unchanged. Toggling the prop recreates the model via anANTIALIASINGdefine.Docs, shader-variant unit tests, no-MSAA WebGL coverage checks, a WebGPU premultiplication check, a golden image, and a 100K-point bench workload cover the new path.
Reviewed by Cursor Bugbot for commit 813a1ad. Bugbot is set up for automated code reviews on this repo. Configure here.