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

Lightmapper: Prevent infinite loop while blitting lightmaps into an atlas #94237

Merged

Conversation

BlueCube3310
Copy link
Contributor

@BlueCube3310 BlueCube3310 commented Jul 11, 2024

Fixes #63423
Follow-up to #94236

Quits the blitting method when a lightmap cannot fit into an atlas. This should never happen though, and is only done to prevent an infinite loop.

TODO:

  • Return a more descriptive error. The current one pops up a window informing the user about the atlas being too big, which is not the case here.

@BlueCube3310 BlueCube3310 force-pushed the lightmap-atlas-loop-fix-always branch from c0ea402 to ca5bd2c Compare July 12, 2024 09:24
@BlueCube3310 BlueCube3310 changed the title Lightmapper: Prevent infinite loop during UV atlas blitting Lightmapper: Prevent infinite loop while blitting lightmaps into an atlas Jul 12, 2024
@BlueCube3310 BlueCube3310 marked this pull request as ready for review July 12, 2024 09:25
@BlueCube3310 BlueCube3310 requested review from a team as code owners July 12, 2024 09:25
@BlueCube3310 BlueCube3310 force-pushed the lightmap-atlas-loop-fix-always branch from ca5bd2c to 63eb6a7 Compare July 12, 2024 09:43
@BlueCube3310 BlueCube3310 requested a review from a team as a code owner July 12, 2024 09:43
@Chaosus Chaosus added this to the 4.3 milestone Jul 12, 2024
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

I can't reproduce the issue in #63423 MRP as of 97b8ad1, but this PR works fine on the MRP too. Either way, adding this safeguard makes sense.

scene/3d/lightmap_gi.h Outdated Show resolved Hide resolved
scene/3d/lightmapper.h Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit 43902f4 into godotengine:master Jul 18, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@BlueCube3310 BlueCube3310 deleted the lightmap-atlas-loop-fix-always branch July 22, 2024 07:23
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.

LightmapGI: Freeze when trying to bake with custom UV2
6 participants