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: Restore instanced multi-draw API and add WebGPU support #28759

Merged

Conversation

RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Jun 29, 2024

Related issue: #28103, #28753

Description

This PR aligns behavior with the WebGLRenderer. I mistakenly removed the object._multiDrawInstances condition in #28753 and it seems that some developers/companies might have already implemented custom multi-draw classes in user-land, and object._multiDrawInstances will provide such an alternative as mentioned in #28103.
This increases flexibility for developers by not limiting the use of the multi-draw API to the current BatchMesh system, which can be restrictive.

Regarding TSL, no action is needed as this is already a quite advanced use case. Developers can override the BatchNode for their custom implementation via setupPosition.

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger merged commit 0286e81 into mrdoob:dev Jun 29, 2024
9 of 10 checks passed
mrdoob pushed a commit that referenced this pull request Jul 2, 2024
…rt (#28759)

* WebGPURenderer: Restore instanced multi-draw API and WebGPU compatibility

* fix firefox since gl_drawID is not mandatory for custom usage
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.

1 participant