why the number of vertices is being rendered 8 or 9 times more than the actual number can it be simplified or at least rendered the same? Is the WebGl taking additional resources for vertices?
Also I tried lots of simplifiers but even after simplifying still not reaching the target which is 30000 vertices.
the current number is around 260000 vertices
Where are you getting the numbers from?
The numbers reported by your modelling program are unlikely to be the same as the numbers reported by renderer.info, for a number of reasons but especially if you are modelling with quads as these will be subdivided into triangles since three.js doesn't support quads.
I am rendering plane and complex shapes renderer.info giving numbers as high as 260000 but actual number is around 27000 any idea?
Again, where are you getting the "actual number" from?
from meshlab or 3d builder
Right, so see my comment above as to why the numbers in three.js are higher. They will pretty much always be higher, especially if you are modelling in quads. Although a factor of 10 higher does seem extreme. Can you share the model file?
Also, you should post this over on the forum, since it's not a bug or feature request.
Copying my comment from the forum as the increase in vertices does seem unusually high here:
Here are the numbers I'm getting:
Loading in Three.js
Polygons: 67340
Vertices: 202020
Loading in 3ds max
Polygons: 67340
Vertices: 36478
So the number of polygons are the same, but the number of vertices is about 5 times higher.
As I mentioned above, there are a number of reasons why vertices can be duplicated - the one I am most familiar with is that the mesh is modelled with quads (4-sided polygons) and these are not supported by three.js so they are subdivided. But that is not happening here as the mesh is already triangulated, and in any case number of polygons is not changed here.
Also, I tried re-exporting as a .FBX and loading this I get the same numbers from three.js as with the .OBJ file, so this is not caused by the OBJLoader.
There are other reasons for multiplying vertices (to do with normals and UVS I think), but I'm not familiar with these.
basically because current line of thought in 3js is to discard indices and duplicate vertices in buffers as needed (here is my ticket for obj loader, for example: #11898) try to do
var geometry = new THREE.Geometry;
geometry.fromBufferGeometry (yourLoadedGeometry);
geometry.mergeVertices ();
console.log (yourLoadedGeometry.getAttribute ('position').array.length / 3, geometry.vertices.length)
to verify this.
Three doesn't give the correct number of vertices at render time.
A - non indexed quad:
2 triangles
6 vertices
B - indexed quad:
2 triangles
4 vertices
When rendering A, info gives the correct number or vertices, as it is a triangle soup. 2 triangles x 3 verts = 6 verts.
When rendering B, it wont do anything different and still just multiply the number of tris by vert.
Since this is the first issue that pops up when searching for this, thought i post it.
Solved via #13404