Skip to content

Vulkan Mobile: Fix lightmap instances count #106907

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

Merged

Conversation

SpockBauru
Copy link
Contributor

Closes: #106906

The max instances of LightmapGI is hardcoded with the magic number 2 instead of using the appropriate enum MAX_LIGHTMAPS. This PR fixes it.

It only works because @BlueCube3310 fixed the _fill_render_list initialization in #106748. That PR not only fixes the editor but also several bugs like lightmap flickering when loading/unloading in runtime.

MRP: lightmap-bug.zip

4.5.dev4

lightmap_bug.mp4

This PR

lightmap_bug_fix.mp4

@SpockBauru SpockBauru requested a review from a team as a code owner May 28, 2025 16:51
@SpockBauru SpockBauru changed the title Mobile: Fix lightmap instances count Vulkan Mobile: Fix lightmap instances count May 28, 2025
@AThousandShips AThousandShips added bug topic:rendering cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels May 28, 2025
@AThousandShips AThousandShips added this to the 4.5 milestone May 28, 2025
@BlueCube3310
Copy link
Contributor

Makes sense to me, it now works the same way as in the clustered renderer. My only concern is whether this was intentional or accidental, and if this affects performance negatively.

The comments in the mobile renderer suggest that the lightmap system was meant to be reworked at some point, but that never happened, so I'm curious if this was implemented as a temporary workaround to some potential performance issues.

@SpockBauru SpockBauru force-pushed the fix-mobile-lightmap-instances branch from 33ffa6b to 7aee6e2 Compare May 29, 2025 19:04
@SpockBauru
Copy link
Contributor Author

Rebased after the awesome (and massive) SHADER BAKER!!!

@SpockBauru SpockBauru force-pushed the fix-mobile-lightmap-instances branch from 7aee6e2 to fe1d499 Compare June 9, 2025 20:58
@akien-mga akien-mga merged commit da05a6b into godotengine:master Jun 12, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@SpockBauru
Copy link
Contributor Author

Thanks everyone! If this PR is going to be cherry picked for 4.4 do not forget to also cherrypick #106748, it's just one line of moved code ^-^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release topic:rendering topic:3d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan Mobile: Lightmaps flicker and unload when there’s more than 2 instances in screen
6 participants