bevy/crates/bevy_gltf/Cargo.toml

44 lines
1.6 KiB
TOML
Raw Normal View History

[package]
name = "bevy_gltf"
2023-08-17 21:42:05 +00:00
version = "0.11.2"
edition = "2021"
2020-08-10 00:24:27 +00:00
description = "Bevy Engine GLTF loading"
homepage = "https://bevyengine.org"
repository = "https://github.com/bevyengine/bevy"
Relicense Bevy under the dual MIT or Apache-2.0 license (#2509) This relicenses Bevy under the dual MIT or Apache-2.0 license. For rationale, see #2373. * Changes the LICENSE file to describe the dual license. Moved the MIT license to docs/LICENSE-MIT. Added the Apache-2.0 license to docs/LICENSE-APACHE. I opted for this approach over dumping both license files at the root (the more common approach) for a number of reasons: * Github links to the "first" license file (LICENSE-APACHE) in its license links (you can see this in the wgpu and rust-analyzer repos). People clicking these links might erroneously think that the apache license is the only option. Rust and Amethyst both use COPYRIGHT or COPYING files to solve this problem, but this creates more file noise (if you do everything at the root) and the naming feels way less intuitive. * People have a reflex to look for a LICENSE file. By providing a single license file at the root, we make it easy for them to understand our licensing approach. * I like keeping the root clean and noise free * There is precedent for putting the apache and mit license text in sub folders (amethyst) * Removed the `Copyright (c) 2020 Carter Anderson` copyright notice from the MIT license. I don't care about this attribution, it might make license compliance more difficult in some cases, and it didn't properly attribute other contributors. We shoudn't replace it with something like "Copyright (c) 2021 Bevy Contributors" because "Bevy Contributors" is not a legal entity. Instead, we just won't include the copyright line (which has precedent ... Rust also uses this approach). * Updates crates to use the new "MIT OR Apache-2.0" license value * Removes the old legion-transform license file from bevy_transform. bevy_transform has been its own, fully custom implementation for a long time and that license no longer applies. * Added a License section to the main readme * Updated our Bevy Plugin licensing guidelines. As a follow-up we should update the website to properly describe the new license. Closes #2373
2021-07-23 21:11:51 +00:00
license = "MIT OR Apache-2.0"
2020-08-10 00:24:27 +00:00
keywords = ["bevy"]
[dependencies]
# bevy
2023-08-17 21:42:05 +00:00
bevy_animation = { path = "../bevy_animation", version = "0.11.2", optional = true }
bevy_app = { path = "../bevy_app", version = "0.11.2" }
bevy_asset = { path = "../bevy_asset", version = "0.11.2" }
bevy_core = { path = "../bevy_core", version = "0.11.2" }
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.11.2" }
bevy_ecs = { path = "../bevy_ecs", version = "0.11.2" }
bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.11.2" }
bevy_log = { path = "../bevy_log", version = "0.11.2" }
bevy_math = { path = "../bevy_math", version = "0.11.2" }
bevy_pbr = { path = "../bevy_pbr", version = "0.11.2" }
bevy_reflect = { path = "../bevy_reflect", version = "0.11.2", features = ["bevy"] }
bevy_render = { path = "../bevy_render", version = "0.11.2" }
bevy_scene = { path = "../bevy_scene", version = "0.11.2", features = ["bevy_render"] }
bevy_transform = { path = "../bevy_transform", version = "0.11.2" }
bevy_tasks = { path = "../bevy_tasks", version = "0.11.2" }
bevy_utils = { path = "../bevy_utils", version = "0.11.2" }
# other
Update gltf requirement from 0.16.0 to 1.0.0 (#3826) Updates the requirements on [gltf](https://github.com/gltf-rs/gltf) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/gltf-rs/gltf/blob/master/CHANGELOG.md">gltf's changelog</a>.</em></p> <blockquote> <h2>[1.0.0] - 2022-01-29</h2> <h3>Added</h3> <ul> <li>Support for the <code>KHR_materials_specular</code> extension.</li> <li>Support for the <code>KHR_materials_variants</code> extension.</li> <li>Support for the <code>KHR_materials_volume</code> extension.</li> <li><code>ExactSizeIterator</code> implementation for <code>Joints</code> iterator.</li> </ul> <h3>Changed</h3> <ul> <li>The <code>mesh.primitives</code> property is now always serialized.</li> </ul> <h3>Fixed</h3> <ul> <li>Incorrect implementation of <code>Normalize&lt;u16&gt;</code> and <code>Normalize&lt;f32&gt;</code> for <code>u16</code>.</li> </ul> <h2>[0.16.0] - 2021-05-13</h2> <h3>Added</h3> <ul> <li>Support for the <code>KHR_texture_transform</code> extension.</li> <li>Support for the <code>KHR_materials_transmission_ior</code> extension.</li> </ul> <h3>Changed</h3> <ul> <li><code>Material::alpha_cutoff</code> is now optional.</li> </ul> <h3>Fixed</h3> <ul> <li>URIs with embedded data failing to import when using <code>import_slice</code>.</li> <li>Serialization of empty primitives object being skipped.</li> </ul> <h2>[0.15.2] - 2020-03-29</h2> <h3>Changed</h3> <ul> <li>All features are now exposed in the <a href="http://docs.rs/gltf">online documentation</a>.</li> <li>Primary iterators now implement <code>Iterator::nth</code> explicitly for improved performance.</li> </ul> <h3>Fixed</h3> <ul> <li>Compiler warnings regarding deprecation of <code>std::error::Error::description</code>.</li> </ul> <h2>[0.15.1] - 2020-03-15</h2> <h3>Added</h3> <ul> <li>New feature <code>guess_mime_type</code> which, as the name suggests, attempts to guess the MIME type of an image if it doesn't exactly match the standard.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/gltf-rs/gltf/commits">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
2022-02-02 00:25:39 +00:00
gltf = { version = "1.0.0", default-features = false, features = [
"KHR_lights_punctual",
"KHR_materials_unlit",
"extras",
"names",
"utils",
] }
thiserror = "1.0"
anyhow = "1.0.4"
base64 = "0.13.0"
percent-encoding = "2.1"
Add morph targets (#8158) # Objective - Add morph targets to `bevy_pbr` (closes #5756) & load them from glTF - Supersedes #3722 - Fixes #6814 [Morph targets][1] (also known as shape interpolation, shape keys, or blend shapes) allow animating individual vertices with fine grained controls. This is typically used for facial expressions. By specifying multiple poses as vertex offset, and providing a set of weight of each pose, it is possible to define surprisingly realistic transitions between poses. Blending between multiple poses also allow composition. Morph targets are part of the [gltf standard][2] and are a feature of Unity and Unreal, and babylone.js, it is only natural to implement them in bevy. ## Solution This implementation of morph targets uses a 3d texture where each pixel is a component of an animated attribute. Each layer is a different target. We use a 2d texture for each target, because the number of attribute×components×animated vertices is expected to always exceed the maximum pixel row size limit of webGL2. It copies fairly closely the way skinning is implemented on the CPU side, while on the GPU side, the shader morph target implementation is a relatively trivial detail. We add an optional `morph_texture` to the `Mesh` struct. The `morph_texture` is built through a method that accepts an iterator over attribute buffers. The `MorphWeights` component, user-accessible, controls the blend of poses used by mesh instances (so that multiple copy of the same mesh may have different weights), all the weights are uploaded to a uniform buffer of 256 `f32`. We limit to 16 poses per mesh, and a total of 256 poses. More literature: * Old babylone.js implementation (vertex attribute-based): https://www.eternalcoding.com/dev-log-1-morph-targets/ * Babylone.js implementation (similar to ours): https://www.youtube.com/watch?v=LBPRmGgU0PE * GPU gems 3: https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-3-directx-10-blend-shapes-breaking-limits * Development discord thread https://discord.com/channels/691052431525675048/1083325980615114772 https://user-images.githubusercontent.com/26321040/231181046-3bca2ab2-d4d9-472e-8098-639f1871ce2e.mp4 https://github.com/bevyengine/bevy/assets/26321040/d2a0c544-0ef8-45cf-9f99-8c3792f5a258 ## Acknowledgements * Thanks to `storytold` for sponsoring the feature * Thanks to `superdump` and `james7132` for guidance and help figuring out stuff ## Future work - Handling of less and more attributes (eg: animated uv, animated arbitrary attributes) - Dynamic pose allocation (so that zero-weighted poses aren't uploaded to GPU for example, enables much more total poses) - Better animation API, see #8357 ---- ## Changelog - Add morph targets to bevy meshes - Support up to 64 poses per mesh of individually up to 116508 vertices, animation currently strictly limited to the position, normal and tangent attributes. - Load a morph target using `Mesh::set_morph_targets` - Add `VisitMorphTargets` and `VisitMorphAttributes` traits to `bevy_render`, this allows defining morph targets (a fairly complex and nested data structure) through iterators (ie: single copy instead of passing around buffers), see documentation of those traits for details - Add `MorphWeights` component exported by `bevy_render` - `MorphWeights` control mesh's morph target weights, blending between various poses defined as morph targets. - `MorphWeights` are directly inherited by direct children (single level of hierarchy) of an entity. This allows controlling several mesh primitives through a unique entity _as per GLTF spec_. - Add `MorphTargetNames` component, naming each indices of loaded morph targets. - Load morph targets weights and buffers in `bevy_gltf` - handle morph targets animations in `bevy_animation` (previously, it was a `warn!` log) - Add the `MorphStressTest.gltf` asset for morph targets testing, taken from the glTF samples repo, CC0. - Add morph target manipulation to `scene_viewer` - Separate the animation code in `scene_viewer` from the rest of the code, reducing `#[cfg(feature)]` noise - Add the `morph_targets.rs` example to show off how to manipulate morph targets, loading `MorpStressTest.gltf` ## Migration Guide - (very specialized, unlikely to be touched by 3rd parties) - `MeshPipeline` now has a single `mesh_layouts` field rather than separate `mesh_layout` and `skinned_mesh_layout` fields. You should handle all possible mesh bind group layouts in your implementation - You should also handle properly the new `MORPH_TARGETS` shader def and mesh pipeline key. A new function is exposed to make this easier: `setup_moprh_and_skinning_defs` - The `MeshBindGroup` is now `MeshBindGroups`, cached bind groups are now accessed through the `get` method. [1]: https://en.wikipedia.org/wiki/Morph_target_animation [2]: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#morph-targets --------- Co-authored-by: François <mockersf@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2023-06-22 20:00:01 +00:00
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"