Skip to content

FogVolume rendering with ambient light - #25286

Open
blaind wants to merge 1 commit into
bevyengine:mainfrom
blaind:fix/fogvolume-render
Open

FogVolume rendering with ambient light#25286
blaind wants to merge 1 commit into
bevyengine:mainfrom
blaind:fix/fogvolume-render

Conversation

@blaind

@blaind blaind commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Objective

Solution

  • The previous implementation used a // TODO gated way to remove render-world components if no volumetric lights were in main world. Migrated to use bevy SyncComponent where VolumetricFog drives synch of VolumetricFog, ViewVolumetricFogPipelines and ViewVolumetricFog
  • Also removed the FogVolume removal, which was already driven by SyncComponent impl for FogVolume by my understanding

Testing

  • Tested by building an example scene with .remove::<VolumetricFog>() and .insert(VolumetricFog {... }) on the main camera. The scene has FogVolume and DirectionalLight - toggling the VolumetricFog component presence toggles the fog visibility as well.
  • The volumetric_fog module would probably benefit of unit tests (none at the moment, did not extend in this PR)

Comment on lines 240 to 245
pub fn extract_volumetric_fog(
mut commands: Commands,
view_targets: Extract<Query<(RenderEntity, &VolumetricFog)>>,
fog_volumes: Extract<Query<(RenderEntity, &FogVolume, &GlobalTransform)>>,
volumetric_lights: Extract<Query<(RenderEntity, &VolumetricLight)>>,
) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can use ExtractComponentPlugin for VolumetricFog and VolumetricLight (Note that VolumetricLight doesn't seem to be cleaned up in the render world).

Also FogVolume should probably clean up GlobalTransform in SyncComponent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree on both. They're pre-existing code though, but I can add here if that's ok by Bevy's MR policies?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FogVolumes silently render nothing when no VolumetricLight exists in the scene

2 participants