Skip to content

Fix wrong component sync for GeneratedEnvironmentMapLight#22860

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
kristoff3r:ks/fix-env-map
Feb 7, 2026
Merged

Fix wrong component sync for GeneratedEnvironmentMapLight#22860
alice-i-cecile merged 1 commit intobevyengine:mainfrom
kristoff3r:ks/fix-env-map

Conversation

@kristoff3r
Copy link
Copy Markdown
Contributor

Objective

Fixes the following log spam (and wrong sync behavior) introduced by #22766:

ERROR bevy_pbr::cluster: Clustered light or decal 5v0 had no assigned index!

Solution

The components here are named in an interesting way. We have 3 components:

  • EnvironmentMapLight
  • GeneratedEnvironmentMapLight
  • RenderEnvironmentMap

When I added the SyncComponent impl I pattern matched on the upper two names, and assumed that EnvironmentMapLight was the main world component and GeneratedEnvironmentMapLight was in the render world.

Actually GeneratedEnvironmentMapLight is a specific way to generate an EnvironmentMapLight, and the render world entity is called RenderEnvironmentMap. Fixing the SyncComponent impl to reflect that fixes the issue.

I still feel like there are other issues after this fix:

  • GeneratedEnvironmentMapLight could really use a better name (GenerateEnvironmentMapLight? RuntimeEnvironmentMapLight?), and better docs.
  • I think it's still missing some syncing logic, as far as I can tell nothing handles the generated EnvironmentMapLight if a GeneratedEnvironmentMapLight is updated or deleted? I didn't do a deep dive so I might have missed something.

Testing

Tested with the light_probe_blending and reflection_probes examples.

@kristoff3r kristoff3r added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 7, 2026
@mockersf mockersf added this to the 0.19 milestone Feb 7, 2026
@kristoff3r kristoff3r added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 7, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 7, 2026
Merged via the queue into bevyengine:main with commit a34f2a0 Feb 7, 2026
49 checks passed
@kristoff3r kristoff3r deleted the ks/fix-env-map branch February 7, 2026 23:23
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-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants