FogVolume rendering with ambient light - #25286
Open
blaind wants to merge 1 commit into
Open
Conversation
beicause
reviewed
Aug 5, 2026
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)>>, | ||
| ) { |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Agree on both. They're pre-existing code though, but I can add here if that's ok by Bevy's MR policies?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
FogVolumes silently render nothing when noVolumetricLightexists in the scene #25284Solution
// TODOgated way to remove render-world components if no volumetric lights were in main world. Migrated to use bevy SyncComponent whereVolumetricFogdrives synch ofVolumetricFog,ViewVolumetricFogPipelinesandViewVolumetricFogFogVolumeremoval, which was already driven bySyncComponentimpl forFogVolumeby my understandingTesting
.remove::<VolumetricFog>()and.insert(VolumetricFog {... })on the main camera. The scene hasFogVolumeandDirectionalLight- toggling theVolumetricFogcomponent presence toggles the fog visibility as well.volumetric_fogmodule would probably benefit of unit tests (none at the moment, did not extend in this PR)