Allow baking VoxelGI nodes off the main-thread #116833
Draft
TitanNano wants to merge 2 commits intogodotengine:masterfrom
Draft
Allow baking VoxelGI nodes off the main-thread #116833TitanNano wants to merge 2 commits intogodotengine:masterfrom
TitanNano wants to merge 2 commits intogodotengine:masterfrom
Conversation
9df47c9 to
9de2aab
Compare
9de2aab to
8165463
Compare
Member
|
This is a step into the right direction! We desperately need to implement this mechanism for other lengthy processes as well (such as lightmap baking), the workaround of doing manual Main iterations causes all kinds of issues (see #104392 (comment) for example). |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of Proposal godotengine/godot-proposals#14243.
VoxelGI::bakeruns on and blocks the main thread. This makes it impossible to bake nodes without a visible freeze. It is also impossible to bake multiple nodes in parallel. Most modern machines should be capable of baking more than oneVoxelGInode at the same time, which will considerably reduce bake times when doing so at runtime / in-game.Comparison between sequential baking and parallel baking:
Example project: Sequential Baking of
VoxelGInodesExample project: Parallel Baking of
VoxelGINodesWhen baking more than one VoxelGI node, doing it in parallel is significantly faster. My test with the two example projects was done on an MacBook M1 Pro.
This PR relies on the changes from #116600 and contains the commit from the other PR.