Skip to content

Refactor affects_lightmapped_meshes, introduce AmbientLightFlags#24509

Open
coreh wants to merge 1 commit into
bevyengine:mainfrom
coreh:refactor-ambient-light-flags
Open

Refactor affects_lightmapped_meshes, introduce AmbientLightFlags#24509
coreh wants to merge 1 commit into
bevyengine:mainfrom
coreh:refactor-ambient-light-flags

Conversation

@coreh
Copy link
Copy Markdown
Contributor

@coreh coreh commented Jun 1, 2026

Objective

  • Make ambient light more consistent with other light sources in the code
  • Pave the way for more ambient light boolean flags other than affects_lightmapped_meshes
  • Make it easier to support monochromatic ambient lights as a follow up once Minimum Viable Monochromatic Lights #24428 lands

Solution

  • Add AmbientLightFlags bitflags struct
  • Rename ambient_light_affects_lightmapped_meshes to ambient_light_flags in GpuLights struct and matching WGSL-side Lights struct
  • Added WGSL AMBIENT_LIGHT_FLAGS_AFFECTS_LIGHTMAPPED_MESHES_BIT constant
  • Set up plumbing to both pass and use the new bitfield consistently with other light flags

Testing

  • Did you test these changes? If so, how? Yes, by viewing the lighting and lightmaps examples
  • Are there any parts that need more testing? Not that I know of
  • How can other people (reviewers) test your changes? Is there anything specific they need to know? Manually verify ambient light still works
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test? macOS

@coreh coreh added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 1, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 1, 2026
Copy link
Copy Markdown
Contributor

@olukowski olukowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and ambient light still works properly in the lighting example on my machine.

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

Labels

A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants