Atmosphere: dark speckles on lit surfaces when the sun is at zenith (NaN in calculate_visible_sun_ratio)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
calculate_visible_sun_ratio から始めます。bevy_pbr/src/atmosphere/functions.wesl で天頂余弦が fast_acos_4 に入る箇所を読み、bevy_pbr/src/render/pbr_lighting.wesl にある、クランプされていない内積 mu_light と比較してください。真下を向いた平行光源を Atmosphere カメラの下に置いて再現し、太陽直下点付近に暗い斑点が出ないか確認します。照らされた面が一様に明るく、すべてのピクセルで太陽の可視性が有限の値に保たれていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 49.7k
- フォーク
- 5k
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bevyengine/bevy のほかの issue
-
C-Bug S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bevyengine/bevy#26536 ·
メンテナーはふだん 2 日以内に返信
-
Placeholder has no default対応中かも @Cyannide が 1 日前に担当しました。 オープンC-Feature S-Needs-Triage
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
bevyengine/bevy#26532 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
C-Feature S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bevyengine/bevy#26500 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
`Selected` should derive Reflect対応中かも @Tatsuya0330 が今日担当しました。 オープンC-Feature S-Needs-Triage
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
bevyengine/bevy#26499 ·
メンテナーはふだん 2 日以内に返信
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogram対応中かも @dev-matru が 4 日前に担当しました。 オープンA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
bevyengine/bevy#26479 ·
メンテナーはふだん 2 日以内に返信
bevyengine/bevy の issue をすべて見る
似ている issue
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openai対応中かも @arvindkumar-ship-it が今日担当しました。 オープンllm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
BerriAI/litellm#51871 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
comp-formats
難易度 2/5 半日 初心者へのやさしさ 64/100
ClickHouse/ClickHouse#131694 ·
メンテナーはふだん 1 日以内に返信
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Copperpour/Copperpour#500 ·
メンテナーはふだん 1 日以内に返信