Skip to content

Restructure rendering crates #18423

Open
Open
@superdump

Description

@superdump

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

  • bevy_mesh
  • bevy_render
  • bevy_core_pipeline
  • bevy_sprite
  • bevy_pbr

Proposed states

Names can be discussed but should be illustrative of the kind of groupings we have in mind.

Rob's suggestion

  • bevy_mesh - mesh stuff not dependent on bevy_render
  • bevy_render - agnostic rendering infrastructure like low level resources, render graph infrastructure, etc
  • bevy_camera - camera stuff
  • bevy_material - contains the one and only Material API
  • bevy_post_processing - post-processing effects like bloom, motion blur, chromatic aberration, etc, etc
  • bevy_antialiasing - all the AA implementations, FXAA, TAA, SMAA, etc
  • bevy_2d - contains the code specific to 2D mesh material rendering, maybe also the default/base 2d render graph
  • bevy_3d - contains the code specific to 3D mesh material rendering, including building blocks like clustering, lights, shadow mapping, etc, maybe also the default/base 3d render graph
  • bevy_standard_material - the implementation of our standard PBR material using the other crates as necessary
  • bevy_color_material - the implementation of a texture + color tint material that could be used also to support sprites, and the sprite abstraction on top of that

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

  • bevy material
  • bevy_3d (contains infra for mesh rendering, light clustering, general 3d algos)
  • bevy_2d (similar but probably cut down to 2d mesh rendering)
  • bevy_pbr (library crate for pbr-specific stuff, probably mostly shaders and lights, maybe physical camera settings)
  • (all of our effects crates like bevy_post_processing, bevy_aa, etc. Hopefully made graph agnostic at some point)
  • bevy_default_graph (name very bikesheddable, contains StandardMaterial and default render graph setup/plugin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenD-ComplexQuite challenging from either a design or technical perspective. Ask for help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions