mirror of
https://github.com/bevyengine/bevy.git
synced 2026-05-06 06:06:42 -04:00
move gltf examples to gltf category (#21141)
# Objective In the context of this PR, there are two access patterns users have when reaching for examples: - "I have a glTF file and I need to figure out what to do with it" - "I want to learn about Bevy feature X" Users wanting to learn about Bevy features can go to any appropriately named examples directory to learn more about that feature. Users who have a glTF file currently have to scan different directories to find glTF related functionality. For example: looking in the 2d directory for custom vertex attribute examples. ## Solution Create a glTF category and move applicable examples there. It is notable that a "gltf" directory *could* accept any example that uses a glTF file, but this should not be the case. The examples in this directory should be focused on the "I have a glTF file and I'm trying to figure out how to work with it" access pattern. If a glTF file is used "as data" to support a feature showcase, then it is not "a gltf example". For example: spawning a Scene from a glTF file is not enough to qualify an example for this directory. I chose to call this directory "gltf" instead of using the "scene" directory so as to leave "scene" for bsn examples in the future. ## Testing ``` cargo run --example custom_gltf_vertex_attribute cargo run --example load_gltf cargo run --example load_gltf_extras cargo run --example query_gltf_primitives cargo run --example update_gltf_scene cargo run --example edit_material_on_gltf cargo run --example gltf_skinned_mesh ```
This commit is contained in:
+77
-77
@@ -752,17 +752,6 @@ description = "Renders simple 2D primitive shapes like circles and polygons"
|
||||
category = "2D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "custom_gltf_vertex_attribute"
|
||||
path = "examples/2d/custom_gltf_vertex_attribute.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.custom_gltf_vertex_attribute]
|
||||
name = "Custom glTF vertex attribute 2D"
|
||||
description = "Renders a glTF mesh in 2D with a custom vertex attribute"
|
||||
category = "2D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "cpu_draw"
|
||||
path = "examples/2d/cpu_draw.rs"
|
||||
@@ -1098,17 +1087,6 @@ description = "Demonstrates how to implement a material manually using the mid-l
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "edit_material_on_gltf"
|
||||
path = "examples/3d/edit_material_on_gltf.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.edit_material_on_gltf]
|
||||
name = "Edit Gltf Material"
|
||||
description = "Showcases changing materials of a Gltf after Scene spawn"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "lighting"
|
||||
path = "examples/3d/lighting.rs"
|
||||
@@ -1188,39 +1166,6 @@ description = "Renders meshes with both forward and deferred pipelines"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "load_gltf"
|
||||
path = "examples/3d/load_gltf.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.load_gltf]
|
||||
name = "Load glTF"
|
||||
description = "Loads and renders a glTF file as a scene"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "load_gltf_extras"
|
||||
path = "examples/3d/load_gltf_extras.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.load_gltf_extras]
|
||||
name = "Load glTF extras"
|
||||
description = "Loads and renders a glTF file as a scene, including the gltf extras"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "query_gltf_primitives"
|
||||
path = "examples/3d/query_gltf_primitives.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.query_gltf_primitives]
|
||||
name = "Query glTF primitives"
|
||||
description = "Query primitives in a glTF scene"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "motion_blur"
|
||||
path = "examples/3d/motion_blur.rs"
|
||||
@@ -1421,17 +1366,6 @@ description = "Renders two 3d passes to the same window from different perspecti
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "update_gltf_scene"
|
||||
path = "examples/3d/update_gltf_scene.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.update_gltf_scene]
|
||||
name = "Update glTF Scene"
|
||||
description = "Update a scene from a glTF file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene"
|
||||
category = "3D Rendering"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "vertex_colors"
|
||||
path = "examples/3d/vertex_colors.rs"
|
||||
@@ -1633,17 +1567,6 @@ description = "Skinned mesh example with mesh and joints data defined in code"
|
||||
category = "Animation"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "gltf_skinned_mesh"
|
||||
path = "examples/animation/gltf_skinned_mesh.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.gltf_skinned_mesh]
|
||||
name = "glTF Skinned Mesh"
|
||||
description = "Skinned mesh example with mesh and joints data loaded from a glTF file"
|
||||
category = "Animation"
|
||||
wasm = true
|
||||
|
||||
# Application
|
||||
[[example]]
|
||||
name = "custom_loop"
|
||||
@@ -4064,6 +3987,83 @@ description = "A scene showcasing light gizmos"
|
||||
category = "Gizmos"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "custom_gltf_vertex_attribute"
|
||||
path = "examples/gltf/custom_gltf_vertex_attribute.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.custom_gltf_vertex_attribute]
|
||||
name = "Custom glTF vertex attribute 2D"
|
||||
description = "Renders a glTF mesh in 2D with a custom vertex attribute"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "edit_material_on_gltf"
|
||||
path = "examples/gltf/edit_material_on_gltf.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.edit_material_on_gltf]
|
||||
name = "Edit glTF Material"
|
||||
description = "Showcases changing materials of a glTF after Scene spawn"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "gltf_skinned_mesh"
|
||||
path = "examples/gltf/gltf_skinned_mesh.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.gltf_skinned_mesh]
|
||||
name = "glTF Skinned Mesh"
|
||||
description = "Skinned mesh example with mesh and joints data loaded from a glTF file"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "load_gltf"
|
||||
path = "examples/gltf/load_gltf.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.load_gltf]
|
||||
name = "Load glTF"
|
||||
description = "Loads and renders a glTF file as a scene"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "load_gltf_extras"
|
||||
path = "examples/gltf/load_gltf_extras.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.load_gltf_extras]
|
||||
name = "Load glTF extras"
|
||||
description = "Loads and renders a glTF file as a scene, including the gltf extras"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "query_gltf_primitives"
|
||||
path = "examples/gltf/query_gltf_primitives.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.query_gltf_primitives]
|
||||
name = "Query glTF primitives"
|
||||
description = "Query primitives in a glTF scene"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "update_gltf_scene"
|
||||
path = "examples/gltf/update_gltf_scene.rs"
|
||||
doc-scrape-examples = true
|
||||
|
||||
[package.metadata.example.update_gltf_scene]
|
||||
name = "Update glTF Scene"
|
||||
description = "Update a scene from a glTF file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene"
|
||||
category = "glTF"
|
||||
wasm = true
|
||||
|
||||
[[example]]
|
||||
name = "fps_overlay"
|
||||
path = "examples/dev_tools/fps_overlay.rs"
|
||||
|
||||
+13
-7
@@ -69,6 +69,7 @@ git checkout v0.4.0
|
||||
- [UI (User Interface)](#ui-user-interface)
|
||||
- [Usage](#usage)
|
||||
- [Window](#window)
|
||||
- [glTF](#gltf)
|
||||
|
||||
- [Tests](#tests)
|
||||
- [Platform-Specific Examples](#platform-specific-examples)
|
||||
@@ -112,7 +113,6 @@ Example | Description
|
||||
[2D Wireframe](../examples/2d/wireframe_2d.rs) | Showcases wireframes for 2d meshes
|
||||
[Arc 2D Meshes](../examples/2d/mesh2d_arcs.rs) | Demonstrates UV-mapping of the circular segment and sector primitives
|
||||
[CPU Drawing](../examples/2d/cpu_draw.rs) | Manually read/write the pixels of a texture
|
||||
[Custom glTF vertex attribute 2D](../examples/2d/custom_gltf_vertex_attribute.rs) | Renders a glTF mesh in 2D with a custom vertex attribute
|
||||
[Manual Mesh 2D](../examples/2d/mesh2d_manual.rs) | Renders a custom mesh "manually" with "mid-level" renderer apis
|
||||
[Mesh 2D](../examples/2d/mesh2d.rs) | Renders a 2d mesh
|
||||
[Mesh 2D With Vertex Colors](../examples/2d/mesh2d_vertex_color_texture.rs) | Renders a 2d mesh with vertex color attributes
|
||||
@@ -156,7 +156,6 @@ Example | Description
|
||||
[Decal](../examples/3d/decal.rs) | Decal rendering
|
||||
[Deferred Rendering](../examples/3d/deferred_rendering.rs) | Renders meshes with both forward and deferred pipelines
|
||||
[Depth of field](../examples/3d/depth_of_field.rs) | Demonstrates depth of field
|
||||
[Edit Gltf Material](../examples/3d/edit_material_on_gltf.rs) | Showcases changing materials of a Gltf after Scene spawn
|
||||
[Fog](../examples/3d/fog.rs) | A scene showcasing the distance fog effect
|
||||
[Fog volumes](../examples/3d/fog_volumes.rs) | Demonstrates fog volumes
|
||||
[Generate Custom Mesh](../examples/3d/generate_custom_mesh.rs) | Simple showcase of how to generate a custom mesh with a custom texture
|
||||
@@ -165,8 +164,6 @@ Example | Description
|
||||
[Lighting](../examples/3d/lighting.rs) | Illustrates various lighting options in a simple scene
|
||||
[Lightmaps](../examples/3d/lightmaps.rs) | Rendering a scene with baked lightmaps
|
||||
[Lines](../examples/3d/lines.rs) | Create a custom material to draw 3d lines
|
||||
[Load glTF](../examples/3d/load_gltf.rs) | Loads and renders a glTF file as a scene
|
||||
[Load glTF extras](../examples/3d/load_gltf_extras.rs) | Loads and renders a glTF file as a scene, including the gltf extras
|
||||
[Manual Material Implementation](../examples/3d/manual_material.rs) | Demonstrates how to implement a material manually using the mid-level render APIs
|
||||
[Mesh Ray Cast](../examples/3d/mesh_ray_cast.rs) | Demonstrates ray casting with the `MeshRayCast` system parameter
|
||||
[Meshlet](../examples/3d/meshlet.rs) | Meshlet rendering for dense high-poly scenes (experimental)
|
||||
@@ -179,7 +176,6 @@ Example | Description
|
||||
[Parenting](../examples/3d/parenting.rs) | Demonstrates parent->child relationships and relative transformations
|
||||
[Percentage-closer soft shadows](../examples/3d/pcss.rs) | Demonstrates percentage-closer soft shadows (PCSS)
|
||||
[Physically Based Rendering](../examples/3d/pbr.rs) | Demonstrates use of Physically Based Rendering (PBR) properties
|
||||
[Query glTF primitives](../examples/3d/query_gltf_primitives.rs) | Query primitives in a glTF scene
|
||||
[Reflection Probes](../examples/3d/reflection_probes.rs) | Demonstrates reflection probes
|
||||
[Render to Texture](../examples/3d/render_to_texture.rs) | Shows how to render to a texture, useful for mirrors, UI, or exporting images
|
||||
[Rotate Environment Map](../examples/3d/rotate_environment_map.rs) | Demonstrates how to rotate the skybox and the environment map simultaneously
|
||||
@@ -199,7 +195,6 @@ Example | Description
|
||||
[Transmission](../examples/3d/transmission.rs) | Showcases light transmission in the PBR material
|
||||
[Transparency in 3D](../examples/3d/transparency_3d.rs) | Demonstrates transparency in 3d
|
||||
[Two Passes](../examples/3d/two_passes.rs) | Renders two 3d passes to the same window from different perspectives
|
||||
[Update glTF Scene](../examples/3d/update_gltf_scene.rs) | Update a scene from a glTF file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene
|
||||
[Vertex Colors](../examples/3d/vertex_colors.rs) | Shows the use of vertex colors
|
||||
[Visibility range](../examples/3d/visibility_range.rs) | Demonstrates visibility ranges
|
||||
[Volumetric fog](../examples/3d/volumetric_fog.rs) | Demonstrates volumetric fog and lighting
|
||||
@@ -222,7 +217,6 @@ Example | Description
|
||||
[Eased Motion](../examples/animation/eased_motion.rs) | Demonstrates the application of easing curves to animate an object
|
||||
[Easing Functions](../examples/animation/easing_functions.rs) | Showcases the built-in easing functions
|
||||
[Morph Targets](../examples/animation/morph_targets.rs) | Plays an animation from a glTF file with meshes with morph targets
|
||||
[glTF Skinned Mesh](../examples/animation/gltf_skinned_mesh.rs) | Skinned mesh example with mesh and joints data loaded from a glTF file
|
||||
|
||||
### Application
|
||||
|
||||
@@ -618,6 +612,18 @@ Example | Description
|
||||
[Window Resizing](../examples/window/window_resizing.rs) | Demonstrates resizing and responding to resizing a window
|
||||
[Window Settings](../examples/window/window_settings.rs) | Demonstrates customizing default window settings
|
||||
|
||||
### glTF
|
||||
|
||||
Example | Description
|
||||
--- | ---
|
||||
[Custom glTF vertex attribute 2D](../examples/gltf/custom_gltf_vertex_attribute.rs) | Renders a glTF mesh in 2D with a custom vertex attribute
|
||||
[Edit glTF Material](../examples/gltf/edit_material_on_gltf.rs) | Showcases changing materials of a glTF after Scene spawn
|
||||
[Load glTF](../examples/gltf/load_gltf.rs) | Loads and renders a glTF file as a scene
|
||||
[Load glTF extras](../examples/gltf/load_gltf_extras.rs) | Loads and renders a glTF file as a scene, including the gltf extras
|
||||
[Query glTF primitives](../examples/gltf/query_gltf_primitives.rs) | Query primitives in a glTF scene
|
||||
[Update glTF Scene](../examples/gltf/update_gltf_scene.rs) | Update a scene from a glTF file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene
|
||||
[glTF Skinned Mesh](../examples/gltf/gltf_skinned_mesh.rs) | Skinned mesh example with mesh and joints data loaded from a glTF file
|
||||
|
||||
## Tests
|
||||
|
||||
Example | Description
|
||||
|
||||
Reference in New Issue
Block a user