Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: hardware clipping support. #28578

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Conversation

aardgoose
Copy link
Contributor

Use WebGL 'WEBGL_clip_cull_distance' and WebGPU 'clip-distances' extensions if available for clipping where possible (not using intersections or alphaToCoverage and max 8 clipping planes).

Tested with WebGL, (WebGPU support not available to test).

@sunag sunag added this to the r166 milestone Jun 7, 2024
@mrdoob mrdoob modified the milestones: r166, r167 Jun 28, 2024
@mrdoob mrdoob modified the milestones: r167, r168 Jul 25, 2024
@mrdoob mrdoob modified the milestones: r168, r169 Aug 30, 2024
@mrdoob mrdoob modified the milestones: r169, r170 Sep 26, 2024
@mrdoob mrdoob modified the milestones: r170, r171 Oct 31, 2024
Copy link

github-actions bot commented Nov 5, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 692.21
171.45
692.21
171.45
+0 B
+0 B
WebGPU 821.89
221.91
823.65
222.43
+1.76 kB
+520 B
WebGPU Nodes 821
221.7
822.77
222.23
+1.76 kB
+531 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 464.56
112.27
464.56
112.27
+0 B
+0 B
WebGPU 542.09
146.75
543.86
147.32
+1.76 kB
+561 B
WebGPU Nodes 498.03
136.5
499.8
137.03
+1.76 kB
+528 B

lint
@aardgoose
Copy link
Contributor Author

@sunag @Mugen87

This now supports clip distances with WebGL and WebGPU, tested with Chrome 131 Beta which supports the clip-distance extension.

The addition of the declaration of gl_ClippingDistance[ n ] is crude, but I don't see other uses of builtins in WebGL.

@sunag sunag merged commit 8bc792b into mrdoob:dev Nov 6, 2024
12 checks passed
@aardgoose aardgoose deleted the hclip branch November 15, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants