Comments (5)
@javagl is correct. node-_161000103jz0271b
has a huge translation component in its matrix. This transform is applied to the primitives when the node hierarchy is flattened. My suggestion would be to make your transform matrix in the glTF more reasonable and then do the conversion. It looks like you're using Cesium for viewing, so you can do the translation by changing the origin of where you place the model instead of storing it in the glTF.
from gltf-pipeline.
@lasalvavida Is there a particular reason to bake the transform into the primitives? I can imagine that there are cases where this makes sense (maybe related to quantization?), but maybe there should be an option to disable this? At least, I found the idea somewhat appealing that a binary glTF is basically the same glTF asset (with the same buffer data, verbatim), only combined into a single file, but without unnecessary structural or semantic modifications.
from gltf-pipeline.
This is similar to #186. Right now the default behavior does not preserve the hierarchy. We plan on adding an optimize
flag that will keep the hierarchy intact when false
.
from gltf-pipeline.
@javagl We do it because this is an optimization pipeline. We want to reduce draw calls and the way to do that is to have fewer primitives. If two primitives are part of meshes on different nodes, we have to transform them to be under the same parent in order to combine them. It may be possible to make this process less greedy (don't transform anything unless there is a primitive we can combine with after flattening), but I think the best answer here is just to allow enabling/disabling of the optimization.
from gltf-pipeline.
Reducing the number of draw calls sounds familiar. (I'm not an expert here, but IIRC the draw calls are less of a problem than e.g. state changes, but I assume that this is optimized in the gltf-pipeline as well).
Intuitively, it could make sense to let the coordinates of one merged geometry refer to the bounding box of this geometry, and still use the nodes to set up the (possibly huge) translations of the merged geometries. But I'm sure that something like this will be part of the different options for the exact implementation of such an optimize
flag that will be considered.
In any case, your suggestion of creating the glb with an identity transform and then translating the whole glb via the root modelMatrix should solve this particular issue.
from gltf-pipeline.
Related Issues (20)
- Draco compression for points HOT 3
- Draco compression breaks EXT_mesh_features and EXT_structural metadata HOT 3
- Draco compression probably breaks `CESIUM_primitive_outline` extension HOT 4
- Compression with gltf containing texture fails HOT 1
- Simple GLTF won't compress HOT 2
- Consider disambiguating resource names HOT 2
- TypeError: uint8Array.subarray is not a function at getStringFromTypedArray
- gltf-pipeline command and script producing errors while runtime HOT 2
- Special characters in filenames cause incorrect operation
- Very poor compression performance HOT 2
- RuntimeError: memory access out of bounds HOT 2
- 'Error: Failed adding attribute _FEATURE_ID_0' HOT 11
- Hope to support compressing GLTF files with image URIs as HTTP addresses into GLB format
- I used draco(-d) compression, why put my custom data to the loss. There are two files in the attachment that have not been compressed. The customized data in 100.glb still exists after compression, but the customized data in 102.glb is lost. HOT 4
- Unpin `mime` and update to v4 or latest
- Use webp encode texture HOT 1
- error:failed adding attribute TEXCOORD_0 HOT 2
- Reverse lightweight file internship HOT 1
- Converting to binary file with library
- Update `forEachTextureInMaterial` to account for extension textures
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gltf-pipeline.