Skip to content
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

Ensure r_aabb is always used when creating surfaces through the RenderingServer #83840

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Oct 23, 2023

Tentative fix for #82890

@kevinkuo52 Is still investigating and may find a better fix. But this change is needed in either case as it is possible for compressed meshes to be created without an AABB and that is a potential big issue.

Link to download Windows Editory Binary for testing (taken from Github Actions)

Bugsquad edit:

@clayjohn clayjohn added this to the 4.2 milestone Oct 23, 2023
@clayjohn clayjohn requested a review from a team as a code owner October 23, 2023 13:04
@akien-mga akien-mga changed the title Ensure r_aabb is always used when creating surfaces through the RenderingServer Ensure r_aabb is always used when creating surfaces through the RenderingServer Oct 23, 2023
@RandomShaper
Copy link
Member

Would it make sense to do r_aabb = AABB() to have some default for cases that don't end up writing to it?

@clayjohn
Copy link
Member Author

clayjohn commented Oct 23, 2023

Would it make sense to do r_aabb = AABB() to have some default for cases that don't end up writing to it?

I added one. In theory, there should be no case where r_aabb isn't written to.

I tested the build from CI on my windows setup and it looks like it does work to avoid the bug. The question is still open as to whether there is another, better fix as well.

@kevinkuo52 It would be interesting to see if just initializing r_aabb to AABB() is enough to fix the bug on your system. If so, then my theory is probably correct and this PR will properly fix the bug.

@kevinkuo52
Copy link
Contributor

kevinkuo52 commented Oct 23, 2023

@kevinkuo52 It would be interesting to see if just initializing r_aabb to AABB() is enough to fix the bug on your system. If so, then my theory is probably correct and this PR will properly fix the bug.

just initializing r_aabb to AABB() didnt fix the issue on my machine (also tried setting AABB aabb = AABB()).

huh this is interesting thought ur theory of "r_aabb is only guaranteed to be written out in the 2D " made a lot of sense.

but just setting r_aabb to AABB() didnt fix it, also tried to set it in different places to make sure (like before towards begining of this function, were AABB aabb is currently initizliezed, in the block of using_normals_tangents before the continue) but still didnt fix it.

it was only fixed with this change of operating directly on r_aabb.
think we can go with this and see if it fixes it for others as well.
Spent a few hours yesterday trying to see if there some underlying issue but sadly didn't gain other useful insight

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed working, so let's go.

If any MSVC compiler engineer wants to debug this further, let us know :)

@akien-mga akien-mga merged commit bb54190 into godotengine:master Oct 26, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the mesh-flat-bug branch October 30, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imported models are flat.
4 participants