-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
GPULightmapper exclude back-face triangles while calculating bounces #52618
GPULightmapper exclude back-face triangles while calculating bounces #52618
Conversation
Does this close #51638? |
It did not remove it completely although together with increasing the setting for |
I found an issue in the implementation of the exclusion. I will commit an improved version of this fix. |
I imagine that this PR fix this, right @williamd67? The house is empty inside with the boards with only one side |
@@ -118,13 +118,17 @@ bool ray_hits_triangle(vec3 from, vec3 dir, float max_dist, vec3 p0, vec3 p1, ve | |||
bool trace_ray(vec3 p_from, vec3 p_to | |||
#if defined(MODE_BOUNCE_LIGHT) || defined(MODE_LIGHT_PROBES) | |||
, | |||
out uint r_triangle, out vec3 r_barycentric | |||
out uint r_triangle, out vec3 r_barycentric, out bool backface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, parameters which are modified by the function to return values use the r_
prefix (like the two other out
parameters here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, I updated the PR and removed the extra parameter.
Edges that are at the edge of a plane, may get behind the scene and will hit back-face triangles which where included in the lighting calculations. This caused leaking of light at the edge of planes. In case a ray hits back-face triangle, it is skipped in the bounce calculations.
1e3ec4c
to
7c19684
Compare
I fixed the issue 'distance checking for back-faces was skipped' I mentioned before. Now it should fix #51638. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great, awesome work :)
Thanks! |
Edges that are at the edge of a plane, may get behind the scene and will hit
back-face triangles which where included in the lighting calculations. This
caused leaking of light at the edge of planes.
In case a ray hits back-face triangle, it is skipped in the bounce calculations.
Now it should fix #51638.