-
-
Notifications
You must be signed in to change notification settings - Fork 75
-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable buffer interleaving? #43
Comments
Model writing behaves differently depending on if you write to Binary GLB, or Json glTF. In binary mode, by default all buffers are merged and embedded in the binary (it's required by glTF standard) In json mode, Buffers are merged to a single .bin file if MergeBuffers is true, or written separately if MergeBuffers is false. So if you want to save a model and write all its internal buffers as separate files, you should write to glTF instead of GLB, and keep MergeBuffers as false. |
That's not what I meant. I wanted to disable interleaving, and trying |
Okey, it's an entirely different thing. I understand you're refering to Strided Vertex Buffers. By default, SharpGLTF is not able to change the internal layout of an existing gltf document. So if you want to load an existing glTF , and save it with a different vertex buffer layout, this is not possible, or at least, not possible in an easy way. When you create a new scene with the Toolkit.SceneBuilder , at the end of the scene creation process, you convert the sceneBuilder to a gltf (schema2) model. The conversion from SceneBuilder to Schema2.ModelRoot has a settings structure It is also possible to convert from a Schema2.ModelRoot to a SceneBuilder, you can see a round trip example here In that same example, I am disabling the creation of strided vertex buffers in this line:
If you need to perform a roundtrip conversion, that is, load a glTF, convert it to a SceneBuilder, and then convert it back to a glTF, you need to be aware that although I did my best to make the conversion as faithful as possible, it's not a feature that's been throughfully tested. So feel free to report any bugs you may encounter. |
Hello,
is it possible to use separate buffers? In this issue it is said that
, but I couldn't find an option to disable this default behavior. Setting
WriteSettings.MergeBuffers = false
didn't helpThis isn't very urgent for us since our post-processing steps will write the final result with separate buffers anyway, but it would be nice to be able to skip that step for quick testing.
Thanks and good work!
The text was updated successfully, but these errors were encountered: