Skip to content

WebGPURenderer: Fix early-z rejection #30891

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

Merged
merged 6 commits into from
Apr 8, 2025
Merged

WebGPURenderer: Fix early-z rejection #30891

merged 6 commits into from
Apr 8, 2025

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Apr 8, 2025

Related issue: #30862 (comment)

Description

This fix improve the ordering of opaque materials by optimizing early-Z rejection, rendering the opaque materials closest to the camera first. We certainly need a mechanism to improve GPU state switching overhead, it should be based on material type similarity rather than the order in which materials were created.

@sunag sunag added this to the r176 milestone Apr 8, 2025
Copy link

github-actions bot commented Apr 8, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.49
78.38
336.49
78.38
+0 B
+0 B
WebGPU 542.09
150.14
542.03
150.12
-58 B
-16 B
WebGPU Nodes 541.55
150.03
541.5
150.02
-58 B
-16 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.42
112.22
465.42
112.22
+0 B
+0 B
WebGPU 614.93
166.19
614.87
166.17
-58 B
-17 B
WebGPU Nodes 569.92
155.59
569.86
155.58
-58 B
-15 B

@sunag sunag marked this pull request as ready for review April 8, 2025 07:04
@sunag sunag merged commit fec7a6c into mrdoob:dev Apr 8, 2025
12 checks passed
@sunag sunag deleted the dev-fix-sort branch April 8, 2025 12:15
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.

2 participants