-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Restructure rendering crates #18423
Comments
Looks good! I like the idea of sharing phases between graphs, just one comment on your suggestion: I don't think |
I started with moving things in and out of I see |
We should restructure in such a way that we can still do #16721. Combining render passes where we can is very important. |
If it's helpful feedback, I'm a huge fan of |
#18437) ## Objective Reduce dependencies on `bevy_render` by preferring `bevy_mesh` imports over `bevy_render` re-exports. ```diff - use bevy_render::mesh::Mesh; + use bevy_mesh::Mesh; ``` This is intended to help with #18423 (render crate restructure). Affects `bevy_gltf`, `bevy_animation` and `bevy_picking`. ## But Why? As part of #18423, I'm assuming there'll be a push to make crates less dependent on the big render crates. This PR seemed like a small and safe step along that path - it only changes imports and makes the `bevy_mesh` crate dependency explicit in `Cargo.toml`. Any remaining dependencies on `bevy_render` are true dependencies. ## Testing ``` cargo run --example testbed_3d cargo run --example mesh_picking ```
Discussions have been happening on Discord about some restructuring the rendering crates and there is some alignment across multiple independent thinkers so I wanted to capture it here. This is open for discussion. Comment and we can update this initial description as we change our minds / gain clarity.
Current state
Proposed states
Names can be discussed but should be illustrative of the kind of groupings we have in mind.
Rob's suggestion
Things like lights, clustering, shadow mapping, should all be reusable for custom materials without having to pull in bevy's default materials (standard material, color material).
I think whether to use the 2D or 3D render graph should depend on the camera entity, and that the render phases should be functional for either. A phase is just a collection of drawable entities. The entities may have mesh data, and do have materials (sprites will be converted to color material using a shared and batchable quad mesh, or whatever mesh data performs best). 2D is then basically 3D in practice (the GPU thinks so) but perhaps you don't use 3D lighting infrastructure most of the time, but you could.
Emerson's suggestion
The text was updated successfully, but these errors were encountered: