Skip to content

2d Lighting #26021

Open
Open

Description

@jgayfer

Goal Description

Bevy does not yet have 2d lighting support. We want to work towards having first party support for 2d lighting that can support a multitude of styles of 2d games. The initial goal is to build out configurable point lights and shadows, while paving the way for more advanced 2d lighting features in the future.

Goal Status

This is a potential Bevy Project Goal. Its state on the Project Goals Board determines if it is Proposed, Postponed, Blocked (Approved), Unstaffed (Approved), Staffed (Approved), Completed, or Declined.

  • Staffing SMEs: Not yet staffed
  • Working Group Link: Working Group not yet formed
  • Design Documents: Design documents not yet written

Activity

  1. added
    X-Needs-SMEThis type of work requires an SME to approve it.
    C-GoalSomething big or high-value that the Bevy Organization wants to accomplish. FOR SME USE ONLY!
    on Oct 3, 2026
  2. moved this to Needs SME Triage in Renderingon Oct 3, 2026
  3. added
    S-Waiting-on-SMEThis is currently waiting for an SME to resolve something controversial
    on Oct 5, 2026
  4. jgayfer commented on Oct 7, 2026

    @jgayfer
    ContributorAuthor

    Okay, I've drafted an initial design document: https://hackmd.io/@jgayfer/ByTHXgNjGl

    The design doc links it already, but I also put up a draft PR to help visualize what the first iteration of the plan might look like: #26053

  5. NthMetal commented on Oct 8, 2026

    @NthMetal

    I'm just curious here, is the more ergonomic api worth the performance tradeoff from forward rendering?
    Is the philosophy from that going to be: "use bevy's 2d lighting if you want something quick and easy to use, but if you need something specific and more performant, then try one of the 3rd party crates or make your own."

  6. jgayfer commented on Oct 8, 2026

    @jgayfer
    ContributorAuthor

    My goal is for the first party system to perform well!

    But you make a good point. There is a lot of elegance to the simplicity of a light map.

    I'm admittedly not a rendering expert. I'm doing my best to keep up, but definitely interested to hear if this approach won't stack up performance wise.

    Ergonomics is one side of it. The other bigger side of it for me, is that I'm not sure how light masks/layers would work in a world of a light map. I suppose you could compute a light map per lighting layer, though I'm not as confident in how to achieve this.

    I view light layers / masks as a must have for a good 2d lighting system, which has influenced the design. I don't believe it's a feature supported by the third-party crates I've looked at.

  7. jgayfer commented on Oct 8, 2026

    @jgayfer
    ContributorAuthor

    As far as philosophy goes, ideally most people would use the first-party option.

    I don't see the space for third-party or custom lighting solutions going away fully however. Some folks will want custom lighting.

    Though my desire would be for a custom solution to be motivated by a specific effect, rather than a lack of first-party performance.

  8. NthMetal commented on Oct 10, 2026

    @NthMetal

    I think forward rendering can stack up, with a little optimization.

    Deferred rendering does also have its advantages especially when it comes to scenarios with alot of meshes being drawn. Maybe it's something that can also be considered in the future since 3d lighting also has forward and deferred rendering in bevy.

    Light layers do seem tricky with deferred rendering though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-GoalSomething big or high-value that the Bevy Organization wants to accomplish. FOR SME USE ONLY!S-Waiting-on-SMEThis is currently waiting for an SME to resolve something controversialX-Needs-SMEThis type of work requires an SME to approve it.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions