-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGLRenderer: Add initial support for multi draw BatchedMesh #27111
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
let elementCount = 0; | ||
for ( let i = 0; i < drawCount; i ++ ) { | ||
|
||
elementCount += counts[ i ]; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is a bit awkward - in order to correctly report the primitive counts drawn we have tally up all the values in the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Regarding your future PR plans, we might want to consider to move |
Yup! Once I'm finished with the implementation in examples I'll move it. |
Related issue: #22376, #27078 (comment)
Description
Add support for the multi draw extension to WebGLRenderer via
WebGLIndexedBufferRenderer
andWebGLBufferRenderer
forBatchedMesh
. The buffers to pass to the multi draw functions are generated in the onBeforeRender function. With this PR non-visible meshes will no longer be rendered at all with the multi draw extension and BatchedMesh will no longer be supported in browsers that do not support the WebGL_multi_draw extension (firefox, opera mobile).Upcoming PR Plans