Atmosphere: dark speckles on lit surfaces when the sun is at zenith (NaN in calculate_visible_sun_ratio)
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Bắt đầu từ calculate_visible_sun_ratio trong bevy_pbr/src/atmosphere/functions.wesl, nơi côsin thiên đỉnh được đưa vào fast_acos_4, rồi so sánh với tích vô hướng không bị giới hạn mu_light trong bevy_pbr/src/render/pbr_lighting.wesl. Tái hiện bằng một đèn định hướng chiếu thẳng xuống dưới camera Atmosphere, và kiểm tra các đốm tối gần điểm subsolar. Hoàn thành khi bề mặt được chiếu sáng đồng đều và độ hiển thị của mặt trời luôn hữu hạn ở mọi pixel.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 49.7k
- Fork
- 5k
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 128
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bevyengine/bevy
-
C-Bug S-Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
bevyengine/bevy#26536 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Placeholder has no defaultCó thể đã có người làm @Cyannide đã nhận 1 ngày trước. Đang mởC-Feature S-Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
bevyengine/bevy#26532 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
C-Feature S-Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
bevyengine/bevy#26500 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`Selected` should derive ReflectCó thể đã có người làm @Tatsuya0330 đã nhận hôm nay. Đang mởC-Feature S-Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
bevyengine/bevy#26499 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`compute_histogram` in auto exposure writes past the end of the 64-bin histogramCó thể đã có người làm @dev-matru đã nhận 4 ngày trước. Đang mởA-Rendering C-Bug D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
bevyengine/bevy#26479 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của bevyengine/bevy
Issue tương tự
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiCó thể đã có người làm @arvindkumar-ship-it đã nhận hôm nay. Đang mởllm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
BerriAI/litellm#51871 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-formats
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 64/100
ClickHouse/ClickHouse#131694 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Copperpour/Copperpour#500 ·
Maintainer thường phản hồi trong vòng 1 ngày