-
-
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
Add a Preview Bake button for quick iteration with LightmapGI #80518
base: master
Are you sure you want to change the base?
Add a Preview Bake button for quick iteration with LightmapGI #80518
Conversation
21b7e3b
to
5540675
Compare
Note that as mentioned on the 3.x PR, you can use the preview bake in your projects if your computer is too weak to handle the full bake. |
f6148ed
to
4691061
Compare
is this implemented? |
@verypleasentusername No, this PR is still very much open. |
4691061
to
28e5f04
Compare
Rebased and tested again, it works as expected.
|
28e5f04
to
0b22b12
Compare
Could this be merged? |
4.3 is currently in release freeze, so new features can only be merged in 4.4 at the earliest. In the meantime, you can decrease Texel Scale before baking and increase it again after baking. This is the single largest contributing factor to bake times in my experience. |
Yep! That's what I am doing. Good to hear that this will be considered for 4.4 though! |
I fixed the conflicts and tested this (with some quick perusal of the source code). It is very useful as it allows for quick previewing of lighting (though some way to bake everything in the map is also needed). I put the fixes here as the conflicts are actually straightforward even if they did confuse git somewhat: https://github.com/badsectoracula/godot/tree/lightmapping-preview-bake |
Thanks for rebasing this PR! I'll incorporate the changes shortly.
|
When using the Preview Bake button instead of Bake Lightmaps, low quality settings will be used instead of settings from the LightmapGI node. A node configuration warning will be displayed besides the LightmapGI node to inform the user that the bake was done in preview mode. This preview bake warning is persisted to storage to make teamwork easier. This helps iterate quicker on a scene's lighting since you don't need to wait as much time to see results. On a simple test scene, Preview Bake is about 3 times faster than a "final" bake with the default LightmapGI settings (if denoising is not the bottleneck). This metric will vary depending on CPU and GPU speed, as the baking process is performed on the GPU but denoising is performedon the CPU. The preview bake settings can be adjusted in the Project Settings. This also prints a message with the effective quality settings before beginning the lightmapping process.
0b22b12
to
27f792e
Compare
Rebased and tested again (with @badsectoracula's help), it works as expected. There was some discussion recently about making baking and saving lightmaps separate operations, so that the preview bake could bake lightmaps without saving them. While this would be slightly faster (especially when developing on a device with slow I/O), it would also prevent using the preview lightmaps when playtesting a project, which can be problematic for some use cases. Sometimes, you want to be able to run the project with some kind of baked lightmaps, even if you don't have the time to do a full lightmap bake. |
The editor already autosaves any modified scenes when you press the play button so it could also autosave the lightmaps when you want to play. I think overall being able to playtest without saving would be a good idea as you may want to try out things without saving - and could probably be implemented via some sort of saving any unsaved modified resources to a temporary file and then passing mappings like "map all loads for But i think this is something for a different topic/proposal than this and could be implemented in the future regardless of having preview bakes or not (which i find very useful) as i don't see any reason to not save (automatically like now or as a separate step in a future change) the preview lightmaps for gameplay testing. At the end it is just different settings for the lightmapper and you may even want to distribute builds with preview lightmaps (e.g. testers who could be testing your gameplay but not necessarily the final graphics will probably still need to know where there are shadows but not care about light leaks or noisy lightmaps). |
Needs another rebase .-. |
master
version of [3.x] Add a Preview Bake button for quick iteration with BakedLightmap #45237.When using the Preview Bake button instead of Bake Lightmaps, low quality settings will be used instead of settings from the LightmapGI node. A node configuration warning will be displayed
besides the LightmapGI node to inform the user that the bake was done in preview mode. This preview bake warning is persisted to storage to make teamwork easier.
This helps iterate quicker on a scene's lighting since you don't need to wait as much time to see results.
On a simple test scene, Preview Bake is about 3 times faster than a "final" bake with the default LightmapGI settings (if denoising is not the bottleneck). This metric will vary depending on CPU and GPU speed, as the baking process is performed on the GPU but denoising is performed on the CPU.
The preview bake settings can be adjusted in the Project Settings.
This also prints a message with the effective quality settings before beginning the lightmapping process.
Testing project: test_lightmap_preview_bake_4.x.zip
Preview
BakePreview bake result
Note
Tangents are a bit broken on this scene, so there are artifacts that would usually not appear.
4 seconds to bake.
"Final" bake result
16 seconds to bake.