I am using RendererStats to optimize my THREE.js (R75) scene for better performance.
RendererStats vertex count is higher than expected. For example, I have a normal sphere with 6 x 6 segments. After mergeVertices(), the geometry shows 32 vertices in the geometry.vertices array, which is expected. However RendererStats shows a count of 180 vertices. Multiple tests of various sizes all show the same results; roughly 5+ times the number of expected vertices listed in RendererStats.
Where do these extra vertices come from and can I avoid generating them?
Bonus question: Does reducing vertex count help improve performance significantly or are my efforts better concentrated elsewhere?
Vertices are shared in your model, so the number of vertices rendered will be greater than the number of vertices in your model.
The number of vertices reported as rendered will be three times the number of triangles. You should have 60 triangles, so that is 180 vertices.
Performance is case-specific, and depends on the complexity of your scene. Consider using SphereBufferGeometry
instead of SphereGeometry
. Avoid an animation loop if you have a static scene. ( i.e., only render when the camera moves.) Use the most resent version of the three.js library.
three.js r.77