Skip to content

Process GeneratedEnvironmentMapLight on-demand#24522

Open
dylansechet wants to merge 3 commits into
bevyengine:mainfrom
dylansechet:manual_envmap_regeneration
Open

Process GeneratedEnvironmentMapLight on-demand#24522
dylansechet wants to merge 3 commits into
bevyengine:mainfrom
dylansechet:manual_envmap_regeneration

Conversation

@dylansechet
Copy link
Copy Markdown
Contributor

@dylansechet dylansechet commented Jun 3, 2026

Objective

GeneratedEnvironmentMapLight currently does work every frame converting a cubemap into an environment map, which can be performance heavy (#24517). This PR makes this conversion happen on demand instead.

This addresses the first item in #20212.

Solution

GeneratedEnvironmentMapLight now exposes a regenerate boolean field, which is reset during extraction. This copies the behavior of TAA's reset field.

However, the boolean isn't quite enough: if the pipelines/assets aren't ready on the frame when regenerate is set to true, nothing runs and you end up with a black env map. To ensure we retry to process the env map until the filtering has actually run, I've created a render world component called RegenerateEnvironmentMap which only gets removed once the filtering has actually run.

Testing

  • Ran the reflection_probes and atmosphere examples

On the reflection_probes example, current PR in yellow and main in red. This was run on a noisy laptop, so should probably be taken with a pinch of salt:

image

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times X-Uncontroversial This work is generally agreed upon 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 3, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 3, 2026
@alice-i-cecile alice-i-cecile requested a review from atlv24 June 3, 2026 16:03
@IceSentry IceSentry requested a review from mate-h June 4, 2026 15:26
@IceSentry
Copy link
Copy Markdown
Contributor

I generally like the solution, but I don't know if we should make this opt in, as in, always update by default. Or at least offer some automatic ways to update it.

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-Performance A change motivated by improving speed, memory usage or compile times 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 X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants