Atmosphere: dark speckles on lit surfaces when the sun is at zenith (NaN in calculate_visible_sun_ratio)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- computer-graphics
Línea de trabajo
Empieza por calculate_visible_sun_ratio en bevy_pbr/src/atmosphere/functions.wesl, donde el coseno cenital entra en fast_acos_4, y compáralo con el producto punto sin limitar mu_light en bevy_pbr/src/render/pbr_lighting.wesl. Reproduce el caso con una luz direccional que apunte directamente hacia abajo bajo una cámara Atmosphere, y revisa si hay motas oscuras cerca del punto subsolar. Está listo cuando la superficie iluminada tiene una iluminación uniforme y la visibilidad del sol es finita en cada píxel.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bevy version and features
- 0.20.1
- Default features; the camera uses
Atmosphere+AtmosphereSettings.
[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
A scene with an atmosphere on the camera and a directional light (the sun) pointing
straight down, i.e. the sun is exactly at the local zenith of the lit surface.
What went wrong
- Expected: surfaces under the sun are evenly lit.
- Actual: random pixels on lit surfaces lose all direct sunlight (only scattered light
remains), which looks like dark speckles. They appear within a few tens of meters
around the subsolar point and are gone about 100 m away from it.
Additional information
Theory: a NaN in calculate_visible_sun_ratio.
bevy_pbr/src/render/pbr_lighting.wesl:
let mu_light = dot(L, local_up); // not clamped, can be slightly > 1.0 due to f32 rounding
bevy_pbr/src/atmosphere/functions.wesl, calculate_visible_sun_ratio:
let sun_zenith_angle = fast_acos_4(mu);
fast_acos_4 computes sqrt(1.0 - abs(x)), which is NaN for |x| > 1. The visibility
ratio then becomes 0, and color *= transmittance * sun_visibility removes the sun
light for that pixel. sample_sun_radiance in the same file already clamps its argument.
Workaround / proposed fix (one line):
let sun_zenith_angle = fast_acos_4(clamp(mu, -1.0, 1.0));
With this change the speckles are gone. Reproduced with two different atmosphere
setups, always around the point where the sun is exactly overhead. Tested on one
machine only. Before/after screenshots attached.
- Lenguaje dominante
- Rust
- Estrellas
- 49.7k
- Forks
- 5k
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bevyengine/bevy
-
C-Bug S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
bevyengine/bevy#26536 ·
Los mantenedores suelen responder en 2 días
-
Placeholder has no defaultPosiblemente ocupada @Cyannide la tomó hace 1 día. AbiertoC-Feature S-Needs-Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
bevyengine/bevy#26532 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
C-Feature S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
bevyengine/bevy#26500 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
`Selected` should derive ReflectPosiblemente ocupada @Tatsuya0330 la tomó hoy. AbiertoC-Feature S-Needs-Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
bevyengine/bevy#26499 ·
Los mantenedores suelen responder en 2 días
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogramPosiblemente ocupada @dev-matru la tomó hace 4 días. AbiertoA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
bevyengine/bevy#26479 ·
Los mantenedores suelen responder en 2 días
Todos los issues de bevyengine/bevy
Issues similares
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiPosiblemente ocupada @arvindkumar-ship-it la tomó hoy. Abiertollm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
BerriAI/litellm#51871 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
comp-formats
Dificultad 2/5 Medio día Aptitud para principiantes 64/100
ClickHouse/ClickHouse#131694 ·
Los mantenedores suelen responder en 1 día
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Copperpour/Copperpour#500 ·
Los mantenedores suelen responder en 1 día