Bakery - GPU Lightmapper (v1.98) + RTPreview [RELEASED]

Unity 2021 seems to have serious issues with shader caching and compilation taking ages.
Shaders taking ages to compile has been an issue for all shader programmers in Unity for a long time, but it was never taken seriously by the Unity team until URP and HDRP came along with their ten million shader compilation derivatives and literally hours of compile time, so I guess they are trying to speed that up but it broke compilation in the process.

Regarding the reflection probes issue in Unity 2021.2.3f1:

I tried deleting the lighting data assets but it did the same thing. Same errors, and the reflection probe doesn’t work when I reload the scene. I’m getting the same errors about the probes file when I bake example_sponza_day. Along with some very broken lightmaps.

Any other ideas on how we can get it working in 2021.2.3f1 ? Or would we have to upgrade to 2021.2.4 ?

8070371--1042811--Sponza_2021-2-3f1.JPG

Noob to unity here, so excuse the question. But is it possible to get specular highlights from fully baked lights with this asset? Not indirect specular in shadowed areas but something that would solve this problem.

Yes, but you need to use Bakery’s specific shaders:
https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_shaders

1 Like

Thanks for your swift reply @atomicjoe one final question. I plan on using this tool to also bake in AO for my dynamic objects. Think this method but in bakery

Does the sound like something that I could do or do you see me running into any pitfalls? Also regarding this topic I saw a twitter post by @guycalledfrank saying this, do you know if that’s still possible as that would help a lot

“Noted :slight_smile: BTW it’s almost undocumented, but you can also bake tangent-space SH (there is an obscure checkbox on the skylight component). I added that to experiment with specular occlusion on dynamic objects. SH gives slightly better precision comparing to BN, albeit at 4x tex cost”

1 Like

The last time I wanted to do that, Bakery didn’t support lightmapping skinned objects, so I ended using per vertex AO on my character, but now it does and I was planning on rebaking my character using Bakery but haven’t done it yet, so I can’t tell, but there is some details in the manual about it:
https://geom.io/bakery/wiki/index.php?title=Manual#Skinned_mesh_renderer_support

Aside from that, you will need to use Bakery’s prefab support to avoid issues with conflicting lightmaps when moving your lightmapped objects to another scene:
https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmapped_Prefab

2 Likes

hi peoples, I’m trying to do a prefab bake. I get this error, can’t load UVBuffer tangent. I searched for this issue here and in the discord maybe I’m doing something stupid, but does anyone know what would cause this?

ah ha! figured it out, the fix for anyone else having this problem, make sure Tangent-space SH is disabled in the experimental settings in your skylight object

1 Like

Hello, I can’t bake shadow if vertex is set in Lightmap Group. I have a model with lods, so I use XAtlas, on my models everything is baked correctly, but there is no shadow. Is it possible to fix this in the settings or is there no such possibility yet?

Hey,
Can you point me where I can find the whole list of modified assets used by UV padding? I have to revert them to the previous state.

8086142--1045793--upload_2022-4-28_17-14-45.png

Thanks

advanced rendering settings → remove UV adjustments → render again

https://geom.io/bakery/wiki/index.php?title=Manual#Asset_UV_Processing

1 Like

Hey, were you able to test & reproduce? We’re going to market shortly & still haven’t been able to resolve these artefacts. Managed to soften them somewhat by increasing samples on both the lights & the bake, which helps, but it’s obvious the root cause is still their & they’re giving us grief. Any help is greatly appreciated.

Super noob question but I would like to use RNM, how do I switch out the standard shader for the Bakery Shader? Without spending HOURS across my whole scene?

Well, you go to each material in your scene and change the Standard or SRP shader in them to the Bakery one.
You can also search your project for all materials, select them all and change the shader for all of them at once, but that will only work if all your materials use the same Standard shader (which is not usually the case).
Other than that, I’m afraid you will have to find a solution in the asset store. Maybe something like Monkey could help, but I haven’t tried.

1 Like

Yeah, there weren’t as many shaders as I was afraid of. I did it manually. Maybe I’ll dive into Monkey a little deeper later on.

1 Like

Having some issues. I have many point lights and one directional light. I’ve added the Bakery Point Light script to each Point Light and Bakery Direct Light to my Directional Light. They have all set their Baked contribution to Indirect Only. The are all also using the Bakery/Standard shader.
When I try to Bake with
Render Mode - Indirect
Directional Mode - RNM
Texels - 40
Bounces - 4

I finally get a result saying 230 Lightmaps will be baked. I hit continue & then BANG! An Error window. The console shows “ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection”

Looks like an error in the script, are there some settings I’m getting wrong?
Thanks.

@guycalledfrank Well it appears I am unable to use Bakery. Even after a complete removal and install. Each time I install I get the following error:

Import FBX Error.
Shader Error in Bakery/Example Shader with Normal Meta Pass. 'Couldn’t open include file Bakery/BakeryMetaPass.cginc in line 53.

But this file does exist at that location. Not sure what’s up.

Hi, I installed and uninstalled Bakery, however it leaves me with an error I couldn’t remove:

Script attached to '!ftraceLightmaps' in scene 'Assets/Scenes/Player Room.unity' is missing or no valid script is attached.

Please help me fix this :slight_smile: I used the unity’s default search bar and I couldn’t find any object named ‘!ftraceLightmaps’

Reinstall Bakery and click on the menu:
Bakery → Utilities → Clear Baked Data → Clear From Scenes → ALL (Data and Bake Settings)

Do this on all affected scenes.

1 Like

OK, done!

8091497--1046846--upload_2022-4-30_15-16-10.png

Look like you just a need a brighter Skylight.

Interesting. Thanks for the investigation! I didn’t even know about parallel asset import before. This seems to be the cause:

8091497--1046867--upload_2022-4-30_15-22-28.png

Although Bakery fills out that static dictionary once and before the importing is started. But it looks like using any static variables is unreliable when parallel import is enabled.

OK, I’ve added a fix that detects if the parallel import is enabled and supplies texture importing data via ftGlobalStorage.asset instead of the static dictionary. Seems to work. Please try updating to the latest patch.

I just… didn’t create it yet. Wasn’t sure if the rotatable volumes will be widely used.

Thanks, tested it. But where should I look?

8091497--1046909--upload_2022-4-30_16-59-39.jpg

8091497--1046912--upload_2022-4-30_17-0-16.jpg

I think it’s related to this: https://geom.io/bakery/wiki/index.php?title=Troubleshooting#Baking_same_asset_in_one_scene_breaks_its_UVs_in_another_scene


To be continued…

1 Like