-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix lightmapper seam blending #91985
Fix lightmapper seam blending #91985
Conversation
@@ -428,6 +428,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i | |||
SWAP(edge.a, edge.b); | |||
SWAP(edge.na, edge.nb); | |||
SWAP(uv2.a, uv2.b); | |||
SWAP(uv2.indices.x, uv2.indices.y); |
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.
A wise man once told me:
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.
Narrator: "It was."
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.
Narrator: "And just like that, the issue was resolved. A single line of code, the smallest of changes, had made all the difference."
Does this also fix #90929? |
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.
Tested locally, this doesn't appear to do much against the seams in the Global Illumination demo project:
Before | After (this PR) |
---|---|
Testing project: global_illumination.zip (bake the LightmapGIAll node)
yeah because those aren't caused by wrong vertex indeces. There's more than one issue with lightmaps If I had to guess those are most likely due to wrong UV offset calculation during seam blending |
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.
Looks great for a Yolo merge before Beta.
For context, that code block swaps all the other properties, so the change makes intuitive sense and the results speak for themselves
I was so happy that I found the bug, only to see now that you beat me to it. (Why doesn't Github notify me when there's a PR that would close an issue that I'm subscribed to?) When the bug is fixed, the blending effect is so subtle that it's difficult to be sure whether it's working or just broken to the point where it does nothing. But there are actually some seams that look smoother with it. The left is with seam blending disabled, the right is with the fix. While I was debugging, I noticed that the texels that are blended often don't perfectly line up with the actual seam. But that is a completely different issue. |
Thanks! Great work tracking this down 🥇 |
Closes #91614