-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Soft shadows of a small light source are not displayed correctly #443
Comments
You may just literally observing the bits in floating point 32 but I'm going to check. |
I believe this condition is responsible: LuxCore/src/slg/lights/spherelight.cpp Line 119 in 9131aa9
It fits with a calculation on the distance and light radius where I observe this change. I'm currently trying to compile what I believe would fix this... |
Ok now after looking closer, the condition as such is actually not calculated wrong. I was misinterpreting at first due to an approximation in it. If I just remove the condition in the line after, the image in my test scene improves a lot. Only when I use very small light radius some error starts to appear (radius = 0.0175 compared to radius = 0.45). Maybe it is worth to remove the fallback condition, if it causes more unexpected results than to have it? Unless you know specific scenes that don't work well that way? |
I may have found a solution. What I did was to still do the cone sampling and subsequent shadow ray tracing, but replace the pdfw's and return value with the computations for a point light. Comparison image: I will submit a pull request so you can have a look if you agree. P.S.: I was wrong about the condition being an approximation, it is correct. I only wonder about a little optimization: if you really need the Max() evaluation, as there already is a check for centerDistanceSquared - radiusSquared < DEFAULT_EPSILON_STATIC just before? |
Change spherelight implementation to provide an alternative to the pointlight fallback (issue #443)
If the point light source is small enough radius(in this example, radius is 0.026 m), it causes problems,
at some point shadow goes from a soft state to an infinitely sharp.
Example scene
softshadowsbug.zip
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: