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

WebGLRenderer: renderer.info.render data is wrong if use BatchedMesh._multiDraw #29531

Closed
agargaro opened this issue Sep 29, 2024 · 1 comment
Labels
Milestone

Comments

@agargaro
Copy link
Contributor

agargaro commented Sep 29, 2024

Description

Using BatchedMesh and multiDrawElementsInstancedWEBGL, the triangles and drawcalls in the renderer.info.render are not correct.

Reproduction steps

  1. Create a new BatchedMesh
  2. Set these multidraw properties (using at least two geometries):
_multiDrawStarts
_multiDrawCounts
_multiDrawInstances
_multiDrawCount
  1. Check renderer.info.render

Code

this._multiDrawStarts = multiDrawStarts;
this._multiDrawCounts = multiDrawCounts;
this._multiDrawInstances = multiDrawInstances;
this._multiDrawCount = range.length - 1;

Live example

In this example I use multidraw to manage the LODs of an InstancedMesh with a single drawcall

https://stackblitz.com/edit/three-ezinstancedthree-js-bug-drawcall-triangles-infomes?file=src%2Fmain.ts

Screenshots

image
Here there should be one draw call and fewer triangles

Version

r169

Device

No response

Browser

No response

OS

No response

@CodyJasonBennett
Copy link
Contributor

Thanks! Was looking into a fix since seeing #29488 and noticing the count was wrong here.

@agargaro agargaro changed the title WebGLRenderer: BatchedMesh triangles aren't reported in renderer.info.render.triangles if use _multiDraw WebGLRenderer: renderer.info.render data is wrong if use BatchedMesh._multiDraw Sep 30, 2024
@Mugen87 Mugen87 added the Bug label Sep 30, 2024
@Mugen87 Mugen87 closed this as completed Oct 1, 2024
@Mugen87 Mugen87 added this to the r170 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants