bevy/crates/bevy_gizmos/src
Antonin Peronnet b574599444
don't use bevy_pbr for base bevy_gizmos plugin (#17581)
# Objective

This PR enables `bevy_gizmos` to be used without `bevy_pbr`, for user
who want to create their custom mesh rendering logic.

It can also be useful for user who just want to use bevy for drawing
lines (why not).

This work is part of a bigger effort to make the bevy rendering pipeline
more modular. I would like to contribute an exemple to render custom
meshes without `bevy_pbr`. Something like
[this](https://github.com/rambip/plant-mesh/blob/main/src/shader/mod.rs)

## Solution

Now, `bevy_pbr` is an optional dependency, and used only to debug
lights.

I query the `ViewUniforms` manually, instead of using `bevy_pbr` to get
the heavy `MeshViewLayout`

## Testing

I'm not used to testing with bevy at all, but I was able to use
successfully in my project.
It might break for some different mesh pipelines, but I don't think so.

---

## Showcase


![image](https://github.com/user-attachments/assets/7fa22d1c-8b4f-456b-a74b-1a579449e9f5)
So nice ...

## Migration Guide

I don't think there is any breaking change


# Remaining work

Before merging it, it would be useful to:
- rewrite the `pipeline_2d.rs` logic to remove the `bevy_sprite`
depedency too
- move `view.rs` to `bevy_render`, so that it can be used in a more
modular way.
~~- include the most recent changes from 0.16~~

---------

Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
2025-03-10 21:16:52 +00:00
..
primitives Improve Segment2d/Segment3d API and docs (#18206) 2025-03-09 20:21:31 +00:00
aabb.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
arcs.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
arrows.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
circles.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
config.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
cross.rs Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
curves.rs Refactor non-core Curve methods into extension traits (#16930) 2024-12-29 19:26:49 +00:00
gizmos.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
grid.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
lib.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
light.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
line_joints.wgsl Retained Gizmos (#15473) 2024-12-04 21:21:06 +00:00
lines.wgsl Add dashed lines (#16884) 2024-12-18 20:43:58 +00:00
pipeline_2d.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
pipeline_3d.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
retained.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
rounded_box.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
view.rs don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00