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

BatchedMesh: Deprecate old instancing render paths. #29655

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

CodyJasonBennett
Copy link
Contributor

@CodyJasonBennett CodyJasonBennett commented Oct 14, 2024

Description

Deprecates the now-unreferenced instanced multidraw rendering paths from #28103, which was superseded by #28404, and does not implement a fallback for Firefox. Instancing is since emulated by appending instances into the multidraw arguments themselves and using indirection for sorting/visibility, which has a fallback implemented for Firefox.

Copy link

github-actions bot commented Oct 14, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 689.92
170.93
690.08
171
+158 B
+66 B
WebGPU 815.35
219.78
815.72
219.94
+365 B
+165 B
WebGPU Nodes 814.86
219.65
815.22
219.82
+365 B
+172 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 462.94
111.81
463.1
111.88
+158 B
+67 B
WebGPU 538.09
145.28
538.45
145.42
+365 B
+140 B
WebGPU Nodes 494.2
135.15
494.57
135.28
+365 B
+133 B

@RenaudRohlinger
Copy link
Collaborator

I heavily rely on the multiDrawArraysInstancedWEBGL API in my projects, and the only current way of accessing it is through the object._multiDrawInstances property. Could we reconsider removing this feature?
Preserving access to the full WebGL API within Three.js is always an advantage, and removing support for this functionality would reduce its versatility.
Keeping it available ensures greater flexibility for developers who need advanced instancing techniques like instance multidraw.

@CodyJasonBennett
Copy link
Contributor Author

This is an unmaintained code path that does not have a fallback for Firefox. Are you aware your projects will not work there? What about the overdraw lack of sorting is creating? Frankly, I think this is about trying to avoid a migration and not in the interest of the project since nothing is unreachable in practice if you implement BatchedMesh yourself and use indirection the three.js API now requires (instancing itself uses indirection, but this is another discussion). If this really were a discussion about low-level API, I have fielded this area quite heavily to enable multi-level mesh streaming with custom renderers and would suggest render methods over private fields or shapes. If you really aren't sure how to accomplish instancing in a custom BatchedMesh, I'm happy to tailor an example, but I maintain the solution we now implement is a strict improvement, and you should be using it.

@CodyJasonBennett CodyJasonBennett changed the title BatchedMesh: Remove old instancing render paths. BatchedMesh: Deprecate old instancing render paths. Oct 15, 2024
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