DiskLight / RectLight with spread < 1: intersect() reports a different pdf than sample()
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/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ệ
- cpp
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Read lib/rendering/pbr/light/DiskLight.cc and RectLight.cc, then locate the corresponding ISPC implementations and compare how sample() and intersect() calculate overlap bounds and PDFs. Reproduce the listed spread and reverse-sidedness cases, and check for relevant tests. Done means intersection PDFs match sampled PDFs for disk and rectangular lights across these cases, with the reported MIS discrepancy resolved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Two related problems in lib/rendering/pbr/light/DiskLight.cc and RectLight.cc (same in the ISPC versions), version 2026.29.1.
1. DiskLight: bounding box instead of the disk
Reproduce. Glossy floor (roughness 0.3) under a disk light, max_depth 1:
| spread | light samples only | BSDF samples only | both |
|---|---|---|---|
| 1.0 | 0.04509 | 0.04510 | 0.04509 |
| 0.95 | 0.04114 | 0.04116 | 0.04139 |
| 0.8 | 0.02979 | 0.02980 | 0.02997 |
Cause. DiskLight::sample() uses mInvArea (1 / (pi R^2)) when the whole disk lies inside the spread region (lightIsInsideSpread), and the overlap rectangle otherwise. DiskLight::intersect() always calls getOverlapBounds, which in the first case returns the 2R x 2R bounding box, so the hit pdf is 1 / (4 R^2). The MIS weights of light and BSDF samples then do not sum to one.
Fix (untested). Use the same case distinction in intersect() as in sample().
2. Reverse and two-sided lights: signed distance
Reproduce. The same floor under a light with sidedness reverse and spread 0.8:
| light | light samples only | BSDF samples only | both |
|---|---|---|---|
| DiskLight | 0.02980 | 0 | 0.02942 |
| RectLight | 0.03794 | 0 | 0.03725 |
Cause. intersect() computes float spreadLength = localP.z * mTanSpreadTheta; with the signed localP.z, which is negative on the reverse side. getOverlapBounds then finds no overlap and returns false without writing width and height; the return value is not checked and the pdf is computed from them. sample() uses the sign-corrected plane distance and is fine.
Fix (untested). Use abs(localP.z), and check the return value of getOverlapBounds.
- Ngôn ngữ chính
- CMake
- Star
- 4.7k
- Fork
- 321
- Merge trung bình
- 13 phút
- Pull request đã merge (30 ngày)
- 3
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 OpenMoonRay/openmoonray
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OpenMoonRay/openmoonray#332 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
OpenMoonRay/openmoonray#320 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
OpenMoonRay/openmoonray#233 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
OpenMoonRay/openmoonray#331 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
OpenMoonRay/openmoonray#329 ·
Tất cả issue của OpenMoonRay/openmoonray
Issue tương tự
-
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
accuracy
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MnkyArts/ProjectAvalanche#16 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
carla-simulator/carla#10223 ·
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 68/100
cofade/open-garden-planner#885 ·
Maintainer thường phản hồi trong vòng 1 ngày