-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uniform Light Sampling Inconsistency Across PBRTv3 and PBRTv4 #471
Comments
As far I know, the area and mesh lights have a bit different implementation from pbrt 3 vs 4 |
Thanks for your comment, @pbrt4bounty. I'm aware of the advertised changes in v4's page. For choosing which light source to cast a ray in NEE, the comparison above does not use the new [Conty and Kulla 2018] method, rather it still uses the same uniform light sampling as available in v3, v2 and v1. I agree that there could be improvements when sampling within a triangle due to the improvement in solid angle sampling for triangles, but it still doesn't explain the huge discrepancy seen above. The very high noise in v3 seems to be coming from the lack of visibility check when doing uniform light sampling (expected). In v4, this appears to be improved upon somehow, but I'm not sure where that happens and how to turn it off so we can try to get something closer to v3's result. Maybe @mmp will have some time in the near future to shed a light on this. |
Are you sure of that? Solid angle sampling is quite helpful for nearby lights. Try modifying pbrt to go back to area sampling for triangle lights and to not use the warp product sampling for the cosine. Those are the main things I can think of that would make a difference like this, even if BVH light sampling isn't being used. |
First of all, I truly appreciate you taking the time on a Sunday to pitch on this, @mmp.
Indeed, I should be way more careful when making claims like that! The hope with this issue is to find out the reasons that contribute to such a drastic change from v3 to v4 so I can more confidently make comparisons on the many-lights sampling project I'm working on.
I modified the
To the best of my knowledge, the above implementation is equivalent to the implementation in PBRTv3, described here (no solid angle sampling and no warp product sampling to approximate the cosine). After applying the above changes, we get noisier estimations around the lights, but it is still not close to what we see in v3. The effect is also distinguishable in this more straightforward cornell-box scene rendered with 4spp. v3v4 without solid angle samplingv4Any other hypotheses on what could be contributing to this change? |
I've thought about this more and reviewed the code and the only things left I can think of are a) a difference in materials (e.g. pbrt-v4 has CoatedDiffuse vs pbrt-v3's plastic material, or b) pbrt-v4 has a bilinear patch primitive, which also has specialized solid angle and warp product sampling code. If the lights are being rendered as bilinear patches, that would make a difference. |
Upon testing the uniform light sampler for Bitterli's standard Classroom scene, I noticed a very significant difference in the rendered images for v3 and v4. The issue is more pronounced when using triangle mesh light sources. This happens even when simplifying all materials to only use pure lambertian diffuse in both cases.
As seen in the attached renderings of 256spp, the main discrepancy happens near the light sources that appear to be handled very differently in both versions. For this example, I'm using the path integrator with maxdepth=1 to mainly test the direct light sampling; and I'm using the simplest independent/random sampler.
Intuitively, it would make more sense to believe the v3's results since there are roughly 1.2k triangle lights in this scene, so randomly sampling 256 of those per pixel would still generate significant noise in the ceiling given that most triangle lights would not be visible.
Is there a special handling on the light sampling that makes it smoother in v4, or is it really a bug?
I'm attaching the slightly modified classroom scene used in the renderings above (diffuse materials + lighting from the light tubes) to make reproduction easier.
classroom.zip
The text was updated successfully, but these errors were encountered: