Volumetric fog: light inside a FogVolume is attenuated over the whole volume's bounding radius, so large volumes get almost no light
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- computer-graphics, game-dev, performance
Direzione di ricerca
Start with bevy_pbr/src/volumetric_fog/volumetric_fog.wesl and trace how render.rs computes bounding_radius. Compare the directional, point, and spot light attenuation paths, then inspect the relevant volumetric fog tests or examples. Done means light attenuation reflects the path through the volume toward each light and large sparse volumes no longer lose nearly all direct light.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bevy version and features
- 0.20.1
- Default features; the camera has
VolumetricFog, the sun is aDirectionalLightwith
shadows andVolumetricLight.
[Optional] Relevant system information
cargo 1.99.1 (5f94df478 2026-08-27)- Windows 11
AdapterInfo { name: "NVIDIA GeForce RTX 5080", vendor: 4318, device: 11266, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "616.92", backend: Vulkan }
What you did
Ground fog over a large open area: one FogVolume around the camera, scaled to a box of
2400 m × 300 m × 2400 m, with a 3D density texture that is mostly empty above the ground
layer.
What went wrong
- Expected: thin fog lit by the sun, brighter where it is thin.
- Actual: the fog gets almost no direct light and looks dark. Making the volume bigger makes it
darker, even when the fog itself (density × thickness) does not change.
Additional information
bevy_pbr/src/volumetric_fog/volumetric_fog.wesl, directional lights (and the same line in the
point/spot light loop):
let light_attenuation = exp(-density * bounding_radius * (absorption + scattering));
bounding_radius is the radius of the sphere around the whole volume (render.rs:
view_from_local.transform_vector3a(Vec3A::splat(0.5)).length()). So every sample is
attenuated as if the light travelled through a full bounding radius of fog at the local
density, no matter where the sample is or how much fog really lies toward the light. For the
2400 × 300 × 2400 m box bounding_radius is ~1.7 km. With density = 0.05,
scattering = 0.35, absorption = 0: exp(-0.05 * 1704 * 0.35) = exp(-30) ≈ 0, so the volume
receives no direct light at all. A small volume with the same density looks fine.
Expected behavior: attenuate over the path from the sample to where the light enters the
volume (distance to the volume boundary along L, from a ray-box intersection in the volume's
local space), or march toward the light through the density texture. For point and spot lights,
over the distance to the light inside the volume.
Workaround we use (a hack, for our case only): replace bounding_radius in that line with a
fixed path length (the thickness of our fog layer), plus a precomputed "sun visibility" channel
in our density texture.
Tested on one machine.
- Lingua principale
- Rust
- Stelle
- 50k
- Fork
- 5.1k
- Merge medio
- 2g 20h
- PR unite (30g)
- 129
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bevyengine/bevy#26718 ·
I maintainer di solito rispondono entro 2 giorni
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bevyengine/bevy#26689 ·
I maintainer di solito rispondono entro 2 giorni
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still renderedForse già presa @adityawrk l’ha presa 2 giorni fa. ApertaC-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
bevyengine/bevy#26688 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
bevyengine/bevy#26684 ·
I maintainer di solito rispondono entro 2 giorni
-
Create a bevy_fuzzy exampleForse già presa @Tatsuya0330 l’ha presa 1 giorno fa. ApertaA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy#26676 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
area:ui effort:medium enhancement P7 source:agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
machine rename accepts a label already used by another machine, making --machine <label> ambiguousApertamaintainer-needed p2 remote triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
userFRM/egui-charts#4605 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno