I have a BufferGeometry
with X vertices indexed by Y triangles. renderer.info
shows Y triangles and Y / 3 vertices. Is this true, is everything just simply rendered with triangle soups?
No, indexed geometries are rendered via gl.drawElements
. The vertices
property of renderer.info
shows in this case the amount of processed indices.
Isn’t it redundant? If it logs A and B and B = A/3, there may be no need to log it?
What am i missing, how is this number relevant?
Um, the problem is that renderer.info.vertices
should always reflect the vertex count of a geometry. But in the case of an indexed geometry, it’s the amount of processed indices. So yeah, right now the information in renderer.info
are somewhat redundant.
IMO, there are two options to make things more consistent:
- Remove
vertices
- Ensure, indexed geometries write their vertex count to
vertices
I vote for B. And noting it somewhere. I stumbled upon this and gave up half way after a few “no it doesnt work” “yes it does”
I’ve actually changed my mind, maybe for now removing vertices might make more sense. It doesn’t look trivial to add the actual vertex count, while this number is misleading.
Yeah, i’ve looked into the code too and we need a considerable amount of refactoring to implement a “non-hacky” solution
Well, aparently it’s even more complicated, and the whole discussion melted my mind. I think im going to log the counts that im interested in, manually, and pretend that renderer.info
never existed
Just for the sake of completeness: The structure of renderer.info.render
has changed with the following PRs:
https://github.com/mrdoob/three.js/pull/13404 and https://github.com/mrdoob/three.js/pull/13431
With R91
, three.js
reports now the amount of rendered primitives: triangles
, points
and lines
. vertices
has been removed.