-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implementation of baseVertex support #6978
base: main
Are you sure you want to change the base?
Conversation
src/scene/mesh.js
Outdated
* - `indexed` specifies whether to interpret the primitive as indexed, thereby using the | ||
* currently set index buffer. | ||
* | ||
* @type {{type: number, base: number, count: number, indexed?: boolean}[]} | ||
* @type {{type: number, base: number, count: number, baseVertex?: number, indexed?: boolean}[]} |
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.
we should initialize it to 0 here as well, instead of leaving it undefined
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.
In most cases, this parameter will be of little use, and there is no need to store it in memory for each primitive.
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.
It's really not much memory. It's more important to have these objects the same "layout" to avoid chrome possibly deoptimizing functions as they accept polymorphic parameters.
Is there an alternative of base vertex but for the WebGL to ensure parity between renderers? |
There is no cheap alternative for WebGL2. Only if you change the array of indices directly, via Mesh.setIndices |
The real solution is for WebGL to support WEBGL_draw_instanced_base_vertex_base_instance on more devices. Till then this is a WebGPU feature (as compute shaders for example) |
that is slightly less (-0.04%) than a month ago. I don't get it. WebGPU supports it, meaning my mac book pro supports it. Some browsers support it on WebGL .. I assume that's not Chrome then? Searching online, Chrome supports it behind a flag .. when they enable it, this will go to 50% |
Fixes #6751
Added support primitive baseVertex for WebGPU and Batching.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.