make loaders to create indexed geometry
See original GitHub issueYou guys aim to deprecate Geometry, and to that end remove it from stuff like OBJLoader. Unfortunately, BufferGeometry you create is flat. If I want to have smooth normals with OBJ model, I am forced to bloat my file and export them. Before I could do
mesh.geometry.computeVertexNormals ();
which was good CPU-vs-file size trade-off. Now, I would have to do
var geometry = new THREE.Geometry ();
geometry.fromBufferGeometry (mesh.geometry);
geometry.mergeVertices ();
geometry.computeVertexNormals ();
mesh.geometry = geometry;
which wastes way more CPU just because you guys destroy index information in the parser, and moreover it will break once you succeed in deprecating Geometry. BufferGeometry can keep this information, so why do you have to choose for me that I do not want it?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Creating an indexed buffergeometry with OBJ Loader messes ...
Creating an indexed buffergeometry with OBJ Loader messes up texture. Hello people of reddit, hope you're having a wonderful time.
Read more >How to get indices from three.js OBJLoader - Stack Overflow
THREE.OBJLoader always creates non-indexed geometries. Meaning the index property of the geometry is null . If you need an index for some ...
Read more >The Buffer Geometry loader in three.js
In this post I will be writing about the BufferGeometryLoader in three.js the popular javaScript library for working with 3D objects.
Read more >I3SLoader | loaders.gl
A loader for loading an Indexed 3d Scene (I3S) layer, and its geometries and textures data. Loader, Characteristic. File Format, I3S Layer. File...
Read more >BufferGeometry#setIndex – three.js docs
BufferGeometry (); // create a simple square shape. We duplicate the top left and ... For indexed BufferGeometry, count is the number of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mrdoob and @makc I promised an answer and did not provide it, yet. Here it is.
The answer is simple: WebGL 2.0 only allows a single index.
Regarding OpenGL I found this: AMD_interleaved_elements is an extension for OpenGL 4.3 Core Profile. If I understand the specs correctly understand the maximum index length is rather short and therefore not suited for large meshes:
Another idea is to write a custom shader that access the different indices from a buffer texture in the vertex shader, but this will decrease rendering performance (see this stackoverflow post).
Yep!