Search Unity

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

Discussion in 'Assets and Asset Store' started by guycalledfrank, Jun 14, 2018.

  1. KarlKarl2000


    Jan 25, 2016
    Is it that? I haven't tested, but could be your easy fix.
  2. guycalledfrank


    May 13, 2013
    Usually related to being out of disk space where the temp folder is. Also:
    - Recently found out it happens if you have a lightmap group with Ambient Occlusion Only mode. Bakery is confused when parts of the scene are AO-only and other parts have normal lighting... I think I'll just add an error message in this case.
    - There was a bug related to baking with SH and 0 bounces, the one Karl spotted above - it was fixed.
    So please try the latest patch first; if that doesn't work, DM me your .ftracelog.txt, it actually should tell which file it failed to load exactly.

    Do you mean you can't see them after a bake? Or the gizmos are not visible? If it's the 1st, make sure your lights are not occluded by some polygons (even backfaces), your materials are not 100% metallic (thus not showing diffuse lighting) and your shaders do support lightmapping. If you can isolate the problem into a small scene, it should help with debugging.

    Bakery works with gamma color space just fine (unfortunately low-end mobiles have to use it) - it's just it's not recommended if you want to get physically correct results.
  3. Felinde


    Sep 19, 2021
    Hello, will the ability to bake Curvature (convexity) on uv2 be added one day? It would be extremely convenient and would qualitatively improve the integration of objects in the scene with each other. Thank you!
  4. KarlKarl2000


    Jan 25, 2016
    Ah ok ok . Thanks for the clarification. :)

    Also I'm getting some weird red errors during baking. I'll dig into it further to see if I can find out the cause, but this is the console error message.:oops:

    Code (CSharp):
    1. Exception caught: System.NullReferenceException: Object reference not set to an instance of an object
    2.   at ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) [0x004b7] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:4288
    3.   at ftBuildGraphics+<ExportScene>d__243.MoveNext () [0x009f9] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:6384
    4. 0x00007ff78a00ec7d (Unity) StackWalker::GetCurrentCallstack
    5. 0x00007ff78a015839 (Unity) StackWalker::ShowCallstack
    6. 0x00007ff78afae103 (Unity) GetStacktrace
    7. 0x00007ff78b65f4ed (Unity) DebugStringToFile
    8. 0x00007ff7891756c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    9. 0x000001d9dc72f333 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    10. 0x000001d9dc72f26b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    11. 0x000001dc3d241eb0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    12. 0x000001dc4f3c4a25 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    13. 0x000001dc41530223 (Mono JIT Code) [ftBuildGraphics.cs:7570] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    14. 0x000001dba37b3299 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    15. 0x000001dc3d242043 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    16. 0x000001dbc8eda090 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    17. 0x000001d9e88fa095 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    18. 0x00007ffd913efeb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    19. 0x00007ffd9132e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    20. 0x00007ffd9132e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    21. 0x00007ff789f326f4 (Unity) scripting_method_invoke
    22. 0x00007ff789f11ef4 (Unity) ScriptingInvocation::Invoke
    23. 0x00007ff789f0caf5 (Unity) ScriptingInvocation::Invoke<void>
    24. 0x00007ff78a04d32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    25. 0x00007ff78a9ac712 (Unity) SceneTracker::Update
    26. 0x00007ff78ab5ed66 (Unity) Application::TickTimer
    27. 0x00007ff78afb429a (Unity) MainMessageLoop
    28. 0x00007ff78afb8b6b (Unity) WinMain
    29. 0x00007ff78c3996be (Unity) __scrt_common_main_seh
    30. 0x00007ffdf1f07344 (KERNEL32) BaseThreadInitThunk
    31. 0x00007ffdf2ba26b1 (ntdll) RtlUserThreadStart

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4288)
    3. ftBuildGraphics+<ExportScene>d__243.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:7570)
    4. ftRenderLightmap+<RenderLightmapFunc>d__304.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5651)
    5. ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4913)
    6. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
  5. guycalledfrank


    May 13, 2013
    Curvature is not ray-traced, it's a purely local geometrical algorithm that compares angles between nearby triangles. Currently Bakery has no methods or optimization structures to compute it. Also it's not bound to the scene or lighting, nor does it require non-overlapping UVs - you can easily precompute it per-asset using any available tool (e.g. Substance, Toolbag, etc). Although you're speaking of "integration of objects"... perhaps you mean something more like a Cavity (or small-scale AO) map that will work where two objects overlap? You can use existing Ambient Occlusion option for that (just set radius to very small).

    Huh, weird, you truly have the talent to find bugs :D Do you have something like meshes with zero submeshes or zero triangles/vertices? It should still work, but it's my only suspicion here.

    In ftBuildGraphics.cs, can you tell me what will this line print before the error?

    FunixGames likes this.
  6. NoxityGames


    Jul 1, 2018
    I have a question - would it be possible to get a version of the Bakery shaders for BIRP that have a separate Metallic and Roughness texture slot? I've tried to add this myself, but the Bakery shaders mainly seem to be a construct of a lot of separate shader features - I expected them to be surface shaders for some reason...
  7. KarlKarl2000


    Jan 25, 2016
    [ UPDATE ] - I can get the bake to work if I just bake again after a failed attempt. This bug is particularly hard to nail down. I'll keep you posted if I can narrow down the steps. :(

    I'm the cursed one after all. :rolleyes::eek::oops:

    Not sure what you mean by zero submesh\triangles. You mean the geometry has 0 triangles? I'm (pretty sure) I don't have any game objects like that. :confused:

    This is weird because, before I updated to the latest Github version, I was able to bake the lightmaps without problems, but had that bug where Bounces = 0 would stop the baking process.

    Ok I inserted the debug. :)

    I didn't notice it before, but this update seems to show a lot of red errors.

    The editor.log file is 60+ MB. I just copied the last few lines from the log.

    Thanks for the help!

    Code (CSharp):
    2. Prop_SmallBox_02 (UnityEngine.GameObject).Prop_SmallBox_02 (UnityEngine.Mesh)
    3. 0x00007ff77036ec7d (Unity) StackWalker::GetCurrentCallstack
    4. 0x00007ff770375839 (Unity) StackWalker::ShowCallstack
    5. 0x00007ff77130e103 (Unity) GetStacktrace
    6. 0x00007ff7719bf4ed (Unity) DebugStringToFile
    7. 0x00007ff76f4d56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    8. 0x00000216eac3ff03 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    9. 0x00000216eac3fe1b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    10. 0x00000216f8ff3f80 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    11. 0x00000218a0123f75 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    12. 0x00000218a0122b0b (Mono JIT Code) [ftBuildGraphics.cs:4278] ftBuildGraphics:CalculateHolderUVBounds (ftBuildGraphics/ExportSceneData)
    13. 0x000002171ea537f3 (Mono JIT Code) [ftBuildGraphics.cs:6387] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    14. 0x00000216f90032b9 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    15. 0x00000216f8ff4113 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    16. 0x00000216eabe4de0 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    17. 0x0000021ade97dad5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    18. 0x00007ffdd792feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    19. 0x00007ffdd786e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    20. 0x00007ffdd786e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    21. 0x00007ff7702926f4 (Unity) scripting_method_invoke
    22. 0x00007ff770271ef4 (Unity) ScriptingInvocation::Invoke
    23. 0x00007ff77026caf5 (Unity) ScriptingInvocation::Invoke<void>
    24. 0x00007ff7703ad32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    25. 0x00007ff770d0c712 (Unity) SceneTracker::Update
    26. 0x00007ff770ebed66 (Unity) Application::TickTimer
    27. 0x00007ff77131429a (Unity) MainMessageLoop
    28. 0x00007ff771318b6b (Unity) WinMain
    29. 0x00007ff7726f96be (Unity) __scrt_common_main_seh
    30. 0x00007ffe44f87344 (KERNEL32) BaseThreadInitThunk
    31. 0x00007ffe46de26b1 (ntdll) RtlUserThreadStart
    33. Prop_SmallBox_01 (UnityEngine.GameObject).Prop_SmallBox_01 (UnityEngine.Mesh)
    34. 0x00007ff77036ec7d (Unity) StackWalker::GetCurrentCallstack
    35. 0x00007ff770375839 (Unity) StackWalker::ShowCallstack
    36. 0x00007ff77130e103 (Unity) GetStacktrace
    37. 0x00007ff7719bf4ed (Unity) DebugStringToFile
    38. 0x00007ff76f4d56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    39. 0x00000216eac3ff03 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    40. 0x00000216eac3fe1b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    41. 0x00000216f8ff3f80 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    42. 0x00000218a0123f75 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    43. 0x00000218a0122b0b (Mono JIT Code) [ftBuildGraphics.cs:4278] ftBuildGraphics:CalculateHolderUVBounds (ftBuildGraphics/ExportSceneData)
    44. 0x000002171ea537f3 (Mono JIT Code) [ftBuildGraphics.cs:6387] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    45. 0x00000216f90032b9 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    46. 0x00000216f8ff4113 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    47. 0x00000216eabe4de0 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    48. 0x0000021ade97dad5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    49. 0x00007ffdd792feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    50. 0x00007ffdd786e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    51. 0x00007ffdd786e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    52. 0x00007ff7702926f4 (Unity) scripting_method_invoke
    53. 0x00007ff770271ef4 (Unity) ScriptingInvocation::Invoke
    54. 0x00007ff77026caf5 (Unity) ScriptingInvocation::Invoke<void>
    55. 0x00007ff7703ad32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    56. 0x00007ff770d0c712 (Unity) SceneTracker::Update
    57. 0x00007ff770ebed66 (Unity) Application::TickTimer
    58. 0x00007ff77131429a (Unity) MainMessageLoop
    59. 0x00007ff771318b6b (Unity) WinMain
    60. 0x00007ff7726f96be (Unity) __scrt_common_main_seh
    61. 0x00007ffe44f87344 (KERNEL32) BaseThreadInitThunk
    62. 0x00007ffe46de26b1 (ntdll) RtlUserThreadStart
    64. MeshBaker-MeshBaker-mesh-mesh (UnityEngine.GameObject).CombinedMesh-CombinedMesh-mesh (UnityEngine.Mesh)
    65. 0x00007ff77036ec7d (Unity) StackWalker::GetCurrentCallstack
    66. 0x00007ff770375839 (Unity) StackWalker::ShowCallstack
    67. 0x00007ff77130e103 (Unity) GetStacktrace
    68. 0x00007ff7719bf4ed (Unity) DebugStringToFile
    69. 0x00007ff76f4d56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    70. 0x00000216eac3ff03 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    71. 0x00000216eac3fe1b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    72. 0x00000216f8ff3f80 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    73. 0x00000218a0123f75 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    74. 0x00000218a0122b0b (Mono JIT Code) [ftBuildGraphics.cs:4278] ftBuildGraphics:CalculateHolderUVBounds (ftBuildGraphics/ExportSceneData)
    75. 0x000002171ea537f3 (Mono JIT Code) [ftBuildGraphics.cs:6387] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    76. 0x00000216f90032b9 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    77. 0x00000216f8ff4113 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    78. 0x00000216eabe4de0 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    79. 0x0000021ade97dad5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    80. 0x00007ffdd792feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    81. 0x00007ffdd786e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    82. 0x00007ffdd786e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    83. 0x00007ff7702926f4 (Unity) scripting_method_invoke
    84. 0x00007ff770271ef4 (Unity) ScriptingInvocation::Invoke
    85. 0x00007ff77026caf5 (Unity) ScriptingInvocation::Invoke<void>
    86. 0x00007ff7703ad32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    87. 0x00007ff770d0c712 (Unity) SceneTracker::Update
    88. 0x00007ff770ebed66 (Unity) Application::TickTimer
    89. 0x00007ff77131429a (Unity) MainMessageLoop
    90. 0x00007ff771318b6b (Unity) WinMain
    91. 0x00007ff7726f96be (Unity) __scrt_common_main_seh
    92. 0x00007ffe44f87344 (KERNEL32) BaseThreadInitThunk
    93. 0x00007ffe46de26b1 (ntdll) RtlUserThreadStart
    96. Exception caught: System.NullReferenceException: Object reference not set to an instance of an object
    97.   at ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) [0x004e2] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:4290
    98.   at ftBuildGraphics+<ExportScene>d__243.MoveNext () [0x009f9] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:6386
    99. 0x00007ff77036ec7d (Unity) StackWalker::GetCurrentCallstack
    100. 0x00007ff770375839 (Unity) StackWalker::ShowCallstack
    101. 0x00007ff77130e103 (Unity) GetStacktrace
    102. 0x00007ff7719bf4ed (Unity) DebugStringToFile
    103. 0x00007ff76f4d56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    104. 0x00000216eac3ff03 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    105. 0x00000216eac3fe1b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    106. 0x00000216f8ff3f80 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    107. 0x00000218a0123f75 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    108. 0x000002171ea601e3 (Mono JIT Code) [ftBuildGraphics.cs:7572] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    109. 0x00000216f90032b9 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    110. 0x00000216f8ff4113 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    111. 0x00000216eabe4de0 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    112. 0x0000021ade97dad5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    113. 0x00007ffdd792feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    114. 0x00007ffdd786e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    115. 0x00007ffdd786e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    116. 0x00007ff7702926f4 (Unity) scripting_method_invoke
    117. 0x00007ff770271ef4 (Unity) ScriptingInvocation::Invoke
    118. 0x00007ff77026caf5 (Unity) ScriptingInvocation::Invoke<void>
    119. 0x00007ff7703ad32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    120. 0x00007ff770d0c712 (Unity) SceneTracker::Update
    121. 0x00007ff770ebed66 (Unity) Application::TickTimer
    122. 0x00007ff77131429a (Unity) MainMessageLoop
    123. 0x00007ff771318b6b (Unity) WinMain
    124. 0x00007ff7726f96be (Unity) __scrt_common_main_seh
    125. 0x00007ffe44f87344 (KERNEL32) BaseThreadInitThunk
    126. 0x00007ffe46de26b1 (ntdll) RtlUserThreadStart
    128. NullReferenceException: Object reference not set to an instance of an object
    129.   at ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) [0x004e2] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:4290
    130.   at ftBuildGraphics+<ExportScene>d__243.MoveNext () [0x03061] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:7572
    131.   at ftRenderLightmap+<RenderLightmapFunc>d__304.MoveNext () [0x009a2] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:5651
    132.   at ftRenderLightmap.RenderLightmapUpdate () [0x0003c] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:4913
    133.   at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00032] in <e3d2e3f6a525465bbf8c67432a3cb6ef>:0
    135. (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 4290)
    137. MergeSectors: done
    138. 0x00007ff77036ec7d (Unity) StackWalker::GetCurrentCallstack
    139. 0x00007ff770375839 (Unity) StackWalker::ShowCallstack
    140. 0x00007ff77130e103 (Unity) GetStacktrace
    141. 0x00007ff7719bf4ed (Unity) DebugStringToFile
    142. 0x00007ff76f4d56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    143. 0x00000216eac3ff03 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    144. 0x00000216eac3fe1b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    145. 0x00000216f8ff3f80 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    146. 0x00000216f8ff3e48 (Mono JIT Code) UnityEngine.Debug:Log (object)
    147. 0x00000216f8ff3df3 (Mono JIT Code) [ftRenderLightmap.cs:3303] ftRenderLightmap:DebugLogInfo (string)
    148. 0x0000021ad202318b (Mono JIT Code) [ftRenderLightmap.cs:7956] ftRenderLightmap:MergeSectorsUpdate ()
    149. 0x00000216eabe4de0 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    150. 0x0000021ade97dad5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    151. 0x00007ffdd792feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    152. 0x00007ffdd786e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    153. 0x00007ffdd786e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    154. 0x00007ff7702926f4 (Unity) scripting_method_invoke
    155. 0x00007ff770271ef4 (Unity) ScriptingInvocation::Invoke
    156. 0x00007ff77026caf5 (Unity) ScriptingInvocation::Invoke<void>
    157. 0x00007ff7703ad32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    158. 0x00007ff770d0c712 (Unity) SceneTracker::Update
    159. 0x00007ff770ebed66 (Unity) Application::TickTimer
    160. 0x00007ff77131429a (Unity) MainMessageLoop
    161. 0x00007ff771318b6b (Unity) WinMain
    162. 0x00007ff7726f96be (Unity) __scrt_common_main_seh
    163. 0x00007ffe44f87344 (KERNEL32) BaseThreadInitThunk
    164. 0x00007ffe46de26b1 (ntdll) RtlUserThreadStart
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4290)
    3. ftBuildGraphics+<ExportScene>d__243.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:7572)
    4. ftRenderLightmap+<RenderLightmapFunc>d__304.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5651)
    5. ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4913)
    6. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    Code (CSharp):
    1. Exception caught: System.NullReferenceException: Object reference not set to an instance of an object
    2.   at ftBuildGraphics.CalculateHolderUVBounds (ftBuildGraphics+ExportSceneData data) [0x004e2] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:4290
    3.   at ftBuildGraphics+<ExportScene>d__243.MoveNext () [0x009f9] in D:\ProjectY\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:6386
    4. 0x00007ff6ad05ec7d (Unity) StackWalker::GetCurrentCallstack
    5. 0x00007ff6ad065839 (Unity) StackWalker::ShowCallstack
    6. 0x00007ff6adffe103 (Unity) GetStacktrace
    7. 0x00007ff6ae6af4ed (Unity) DebugStringToFile
    8. 0x00007ff6ac1c56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    9. 0x0000019e78619143 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    10. 0x0000019e7861905b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    11. 0x0000019ed6b4b730 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    12. 0x0000019dea1268b5 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    13. 0x0000019dea080223 (Mono JIT Code) [ftBuildGraphics.cs:7572] ftBuildGraphics/<ExportScene>d__243:MoveNext ()
    14. 0x0000019dee6332b9 (Mono JIT Code) [ftRenderLightmap.cs:5651] ftRenderLightmap/<RenderLightmapFunc>d__304:MoveNext ()
    15. 0x0000019dee625b53 (Mono JIT Code) [ftRenderLightmap.cs:4913] ftRenderLightmap:RenderLightmapUpdate ()
    16. 0x0000019e74aeb610 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    17. 0x0000019e7d7ac925 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    18. 0x00007ff9483cfeb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    19. 0x00007ff94830e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    20. 0x00007ff94830e8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    21. 0x00007ff6acf826f4 (Unity) scripting_method_invoke
    22. 0x00007ff6acf61ef4 (Unity) ScriptingInvocation::Invoke
    23. 0x00007ff6acf5caf5 (Unity) ScriptingInvocation::Invoke<void>
    24. 0x00007ff6ad09d32b (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
    25. 0x00007ff6ad9fc712 (Unity) SceneTracker::Update
    26. 0x00007ff6adbaed66 (Unity) Application::TickTimer
    27. 0x00007ff6ae00429a (Unity) MainMessageLoop
    28. 0x00007ff6ae008b6b (Unity) WinMain
    29. 0x00007ff6af3e96be (Unity) __scrt_common_main_seh
    30. 0x00007ff9a26f7344 (KERNEL32) BaseThreadInitThunk
    31. 0x00007ff9a30a26b1 (ntdll) RtlUserThreadStart
    This is the very first red error.
    Code (CSharp):
    1. ArgumentException: Getting control 12's position in a group with only 12 controls when doing repaint
    2. Aborting
    3. UnityEngine.GUILayoutGroup.GetNext () (at <04b2664316804d17bf325b884567dc2b>:0)
    4. UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <04b2664316804d17bf325b884567dc2b>:0)
    5. UnityEngine.GUILayoutUtility.GetRect (System.Single width, System.Single height, UnityEngine.GUILayoutOption[] options) (at <04b2664316804d17bf325b884567dc2b>:0)
    6. UnityEditor.EditorGUILayout.Space (System.Single width, System.Boolean expand) (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    7. UnityEditor.EditorGUILayout.Space () (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    8. ftRenderLightmap.OnGUI () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1586)
    9. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    10. UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    11. UnityEditor.DockArea.OldOnGUI () (at <e3d2e3f6a525465bbf8c67432a3cb6ef>:0)
    12. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    13. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    14. UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    15. UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    16. Rethrow as ImmediateModeException
    17. UnityEngine.UIElements.UIR.RenderChain.Render () (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    18. UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    19. UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    20. UnityEngine.UIElements.Panel.UpdateForRepaint () (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    21. UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    22. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    23. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    24. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    25. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <1aaa12d3c5d64d42836d89caff78b60b>:0)
    26. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <04b2664316804d17bf325b884567dc2b>:0)
    Last edited: Nov 30, 2023
    guycalledfrank likes this.
  8. RedVonix


    Dec 13, 2011
    Trying to use Bakery and having a few issues with it. Been posting in the Discord for a few days now but not getting any responses there...

    I've got a full RNM setup in my scene, and with the materials set to BakeryURPRNMGraph. It seems extremely inconsistent when it works however. Like yesterday, it looked fantastic. Today I did a bake, and all the BakeryURPRNMGraph materials lost all specular, and I had to change them to all to BakeryURPDirSpec to get specualr again. What is causing such an inconsistency?

    Also, the BakeryURPRNMGraph materials are, in some places, rendering as solid black, but if I change it to BakeryURPDirSpec they no longer render in solid black - but they also in those case then lose their specular mapping.

    Also, I'm trying to see if there is any way to allow my characters to cast dynamic shadows into a baked scene, as I'd like them and dynamic objects to cast shadows, but I can't seem to find a way to make that happen with Bakery and could use some support with it.

    In addition, I am also finding some parts of our scenes have what almost looks like the shadows are rendered in grid sections - like I can see seams and edges of a grid of shading going across the surface.

    Could really use some help here to achieve desired results - thank you!
  9. Evgenius


    Sep 4, 2013
    Hello there! I've managed to bake and correctly use Bakery Volumes, but I can't find a way to bake volumes into prefab. Light is properly stored vie Bakery Lightmapped Prefab. When I bake all together (just a single prefab in an empty room), I get a progress window, that goes up to 100% and never ends. If I press cancel several times, I get stored light, but not stored volumes. In fact, the texture are created, but they're not used. If I set a new instance, and enter debug mode, it shows references to the textures, but it also says VRAM 0.0 MB, and dynamic objects don't change they appearance. How to fix it?
  10. Sebastien_Khai


    Jul 2, 2020
    Hi everyone,
    I've got a problem that I can't solve and I've tried a lot of things, but I can't come up with anything concrete.
    During my baking and in IOS plateform, it seems that my directional is indeed reversed (negative) and I can't get a correct impact.
    I've tried with the project settings, via the bakery tab, and with the lights directly, but I can't find a solution.
    Does this problem sound familiar to anyone?
  11. RedVonix


    Dec 13, 2011
    I'm having a problem where the baked lightmaps look entirely different on the Nintendo Switch than they do in-editor. What would cause per-platform differences in this?

    (Also, I'm not seeing any recent responses here or on Discord from the developer - is this asset no longer supported?)
  12. KarlKarl2000


    Jan 25, 2016
    Frank is developing his own game at the same time. So he responds in weekly-ish intermissions. Sounds like porting to Switch is going to be an adventure for me too. :oops:
    Last edited: Nov 30, 2023
    guycalledfrank likes this.
  13. RedVonix


    Dec 13, 2011
    My company quite literally does console ports, with Switch as a key target. If you're doing your own porting feel free to hit me up and we can compare Bakery notes. :)

    (For reference... we're using Bakery currently in a game that was originally HDRP and needed to be converted to URP to work on other platforms... so I feel safe saying we got some stuff figured out there, lol.)
    guycalledfrank likes this.
  14. nantoaqui


    Oct 1, 2014
    I'm trying to figure out this weird behavior. The scene looks great baking using Bakery, but the moment I hit play it turns into that ugly thing o_O

    After hitting play and exiting game mode.
  15. KarlKarl2000


    Jan 25, 2016
    Sounds good!

    Going from HDRP to URP sounds like a nightmare.:eek:
  16. guycalledfrank


    May 13, 2013
    Bakery shader is a clone of Unity's own standard shader... implementing it in a surface shader is hard, since it doesn't allow to fully customize lighting the way I needed to.
    Here, I made a quick change, so it has a separate Roughness map instead of Smoothness (attached).

    Thanks for the detailed log!
    So I can see the error is caused by:

    1. Prop_FanSpine: has a renderer, but no mesh assigned? Usually Bakery detects and filters these out early; however, in this case maybe it's some odd disappearing procedural mesh that re-generates in edit mode?

    2. MeshBaker-MeshBaker-mesh-mesh (UnityEngine.GameObject).CombinedMesh-CombinedMesh-mesh:
    the most puzzling case, as it's non-null during the Debug.Log, but null just a few lines after it?...

    - If you can repro it on a small project, send it to me :)
    - MeshBaker might be or might not be messing with meshes during export.
    - Check the FanSpine, what about its renderer/filter/mesh?

    RNM graphs don't have baked specular, unlike the DirSpec. I'm not sure exactly how it worked with RNM graphs for you. Do you mean lightmap specular or reflection probe specular or light specular?... These are all separate effects.
    By the way, any specific reason why you chose RNM over other directional methods? SH has generally superior quality.

    Very odd! If you can send me any test package or tell any steps I can take to reproduce it, I'll debug it.

    Is it on a terrain or everywhere? Are you using OptiX 6/7 as a denoiser? Perhaps it's this:

    Ah, I think you've emailed me as well. Copying my answer:

    >Just tested it on your version of Unity, and everything seems to be working, apart from prefab overrides not being applied when the volume data is set for the first time - meaning you need to apply prefab overrides manually, and then it'll stay applied forever, not matter how many times you rebake it.
    There is no need to wait for the bake to finish and guess the results - if you have "Lightmapped prefab validation" enabled (it's enabled by default), Bakery will warn about unapplied prefabs right after you click Render, and suggest applying them first.

    I didn't get to the infinite un-close-able window state that you mentioned in my tests, but there is one potential cause for it: namely the odd workaround for the odd post-2018 Unity behaviour where it can re-apply lightmaps to prefabs after the Editor window if focused - therefore it waits for Unity to become focused and then continues. If the last line in the Unity console is "Waiting for Unity editor focus", then that's it. Is it somehow the case? Or is there any error? Does it happen consistently every time, or only occasionally? Did you compile any scripts or loaded different scenes while the bake was running?

    Does it happen in the editor or only on real iOS?
    If it's the latter, perhaps it's missing some shader variants in the build (especially if you're using directional/shadowmask modes):
    But if it even happens in the editor... I'm not sure. Do you have any screenshots? Maybe you're using very high intensity values (HDRP style), and somehow Unity incorrectly converts them to 8 bit?
    Or, are you using an old version of Bakery with OptiX 7 denoiser? There was a bug it its implementation that resulted in a similar effect, but it was fixed a long time ago.

    Do you have any screenshots to compare? Is there any difference when using the built-in lightmapper? The first thing that comes to my mind is simply texture encoding/compression difference - I bet Switch doesn't have compressed HDR formats, so there can be some clamping. But if you're not using extreme intensities, there shouldn't be a huge difference. Screenshots could help.

    The asset is supported :) Sorry, I just have to work on 3 projects at the same time, so there are some response delays; and I had to leave Discord (except for DMs), because it's just a non-stop unordered message flood that explodes my head. BUT I do answer every forum/email/github issue/DM.

    Aha... HDRP, where the recommended sun intensity is 10000? Hopefully you changed light intensities during porting.
    On mobile-ish you're limited to 2 (dLDR) or ~35 (RGBM):

    Oof! Is there any mesh combining (not related to standard batching) happening when the game starts?
    Does it happen with my example scenes (e.g. sponza?)
    Can you also check if deleting the existing LightingDataAsset will fix it?
    Also try the latest patch in case it's something I fixed:
    If that doesn't help... any chance you can make a small unitypackage/project where I can reproduce it?

    Attached Files:

  17. The_Heavynator


    Jan 22, 2018
    so i dont know if somthing broke or if i have somthing misconfigured but i recently migrated to unity 2022 from 2019 and noticed some nasty seams occurring all over one of my scenes and managed to narrow it down to the directonal map.
    for some reason the directonal map no longer has any dilation causing the light directon to effectivly "bend" around the edges of uv islands creating very noticeable seams where that happens. i also noticed this happening on the example lightmaps that come with bakery so i dont think this is a me issue. upload_2023-12-11_12-5-15.png
    directonal map from 2019
    And the directonal map from 2022.
    Last edited: Dec 12, 2023
    guycalledfrank likes this.
  18. NoxityGames


    Jul 1, 2018
    Thank you a lot!
    guycalledfrank likes this.
  19. dec-dev0


    Mar 21, 2014

    Maybe the question has already been posted but i couldn't find the answer.
    I am the CG artist in charge of making the scenes for the team's devs, and of course i also have to do the lighting. I export my scenes into .unitypackage files but my coworkers don't get the baked scene when they load the file, yet I export the baked maps into the package.

    So here is my question - Can we easily export the baked lighmaps for others without them having to render on their computer ?

  20. rc-alexf


    Mar 22, 2022
    Hi Frank, I have a question/request:
    Does bakery mix the ambient occlusion to the maps during render time, or does it composite it after it's finished?
    If the later, is it possible to make it behave like enlighten, where the ambient occlusion is baked alone on the alpha channel?

    With enlighten we are able to access the ambient occlusion channel as an extra shader information, without any extra draw call or extra memory usage. Unity just never had the competence to utilize this channel properly. On progressive it creates a completely useless alpha channel and yours just make an rgb hdr (which makes sense, since unity one is useless, why add it).

    With the extra alpha we could assign it to the AO property of many shaders or even do super cool things like controlable snow maps, dirt, etc, very cheaply, looking better than screen space effects, as Unreal has been doing for many years.

    I understand that that would make the shader slightly heavier, with an extra multiply operation, being done in real time instead of bake time. But maybe you could have an option like "apply AO to the lightmap and mess it up, in unity standard behaviour" or "do not apply AO to the map, instead as an alpha channel calculated in real time". Maybe with better phrasing. But it would still be very light so it's possible that if you just change it no one would mind.

    Anyway, just an idea. But a super useful one. We are having to try using enlighten just because of this. And that would be another aspect where Bakery would be superior to unity default one.
    guycalledfrank likes this.
  21. Enverex


    Jul 6, 2019
    I recently had to upgrade one of my projects from 2019 to 2022. The smaller scene in the project bakes fine, but the larger scene in the project now fails with an incredibly vague error:


    How can I resolve this? I don't see any clear reference to what objects it's failing over here.

    EDIT: The issue was a Light Mesh on an object that Bakery REALLY didn't like but for some reason wasn't an issue until I upgraded from Unity 2019 to 2022?
    Last edited: Dec 13, 2023
    guycalledfrank likes this.
  22. hcpinteractive


    May 20, 2019
    I get following error while using attached ies file in bakery light. I have tested in 3ds max and it works fine there. Anybody faced similar issue and might know solution?

    "iies2tex error: IES file is not valid. See console for details. (4) with args "D:/work by darshit/WorkFromHome/Unity/tmp/PMR/PMR/Assets/../Assets/HCP/IES/RC2a_XAL__23_11_SASSO_100_round_downlight_trim_048-2700617W_048-2796317_002-90774.ies" "C:\Users\DARSHI~1.JOS\AppData\Local\Temp\frender/" 1
    UnityEngine.Debug:LogError (object)
    ftBuildLights:SavePointLightTexture (UnityEngine.Object,string,string,bool,bool,bool) (at Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs:970)
    ftBuildLights:BuildLights (BakeryPointLight[],int,int,bool[],int,bool,string) (at Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs:1136)
    ftRenderLightmap/<RenderLMDirect>d__313:MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:8744)
    ftRenderLightmap/<RenderLightmapFunc>d__289:MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5984)
    ftRenderLightmap:RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4746)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()i"
    guycalledfrank likes this.
  23. Enverex


    Jul 6, 2019
    I'm running into an issue that's completely blocking my project at this point. Bakery keeps making atlasses that overlap with each other. Here's a few examples:




    I have Bakery set to Adjust UV Padding. I'm using the Default unwrapper (as XAtlas was just too slow) and I'm using XAtlas to pack because otherwise there's just far too much wasted space.

    Any ideas why this is happening?
  24. TahlyanSD


    Aug 11, 2015
    Hello I am new to HDRP. I recently converted my project from the Built In Render Pipeline. I have been using Bakery for some time now and was able to get it working properly in Built In RP but I am having some issues with HDRP. Let me start by saying I am a designer by trade and really don't fully understand how lightmapping should be working. I have maybe 6 months of experience at this point and it hasn't been easy. And apologies if this is not the correct place for this in the forum. Please direct me to the correct location if you wish although I do have some Bakery/lightmapping related questions.

    1) My rock formations have been baked using Bakery lightmaps. But they appear all glossy when they are not hit by the directional sunlight. I have placed some large, spherical reflection probes floating off to the side but that does not seem to help. The terrain is not set to Static here so was not baked with lightmaps on purpose. The sun is set to 100,000 LUX/Temp 5500 Kelvin and has the Bakery Direct Light script on it:
    Here are the sun settings:
    100,000 LUX/Temp
    5500 Kelvin
    Affect Diffuse: true
    Affect Specular: true
    Intensity Multiplier: true
    Include for Raytracing: true
    Volumetrics: Enabled/Multipler: 16/Shadow Dimmer: 1

    And here are my global volume settings:
    Exposure: Automatic Histogram/Limit Min/Max: 5/13
    Visual Environment: HDRI Sky Ambient Mode: Dynamic
    Tone Mapping: ACES
    Volumetric Clouds: Enabled with Local Clouds: Enabled
    Indirect Lighting Controller: 1/Everything/1/Everything/1
    Cloud Layer: Opacity 1/Layers: Single/Exposure Comp: 2
    Screen Space Reflection: Opaque Enabled/Transparent Enabled/Tracing Ray Marching Algorithm Approximation
    HDRI Sky: Intensity Mode: Lux (desired Lux Value 100,000)/ Update Mode: On Changed

    2) The reflection probes all say "Baked reflection probe normalization data is invalid at the bottom". This error seems to go away when I have baked lightmaps using the Unity Progressive GPU (Preview) but it takes forever and I already have Bakery setup to stream my lightmapping textures. How do you bake reflection probes in HDRP properly when using Bakery?

    3) After baking lightmaps with the Bakery Direct Light script on my sun (directional light), the sun stops casting dynamic light and the only way I can get this to appear is to add a second directional light which seems like not something I would want to do. The sun is set to Mode: Mixed. If you bake the directional light with Bakery in HDRP, do you have to duplicate the sun too and leave both on during runtime?

    4) Are there any good step by step tutorials, video or text format, that are available for combining HDRP and Bakery lightmap baking and the differences in the pipeline of baking lightmaps with Bakery instead of using the Unity Progressive GPU (Preview) (which takes hours where as Bakery takes minutes)? Specifically I am trying to figure out whether I should be lightmapping a large, open day time area, that leads into a small, dark corridor or should I just lightmap the small, dark corridor? And basically how do I control all the indirect light that is coming from the clouds, sky, exposure, etc. when a dark area is right next to a bright area.

    Thank you in advance for any help you can respond with.

  25. guycalledfrank


    May 13, 2013
    In case anyone was wondering how to reuse the same lightmap on all LODs, I made a little script :)

    I was debugging it today for a couple of hours... until I realized that somehow the version of addDir.ptx in the store package is broken. Even just getting the latest github patch will fix it (though the fixed version is 2 years old). I'll make sure the next store release will have that version :)
    I'm also attaching the correct addDir.ptx to this post.

    Yes, you should be able to! But you also need to include some scripts so lightmaps can be applied:

    It's rendered separately and composited.

    I didn't know Enlighten did that! Were Unity shaders aware of it, did they use it somehow?
    But yes, it is possible, except you can't really pack it together with the color as a lot of HDR compression methods don't leave free alpha channel (BC6H doesn't have an alpha channel, RGBM uses alpha for intensity...). Directional maps in Unity also store a special normalization factor in alpha... and shadowmasks store the 4th mask.
    So the only real possibilities I see are:
    - Use LDR color (RGBA8) (very old-school).
    - Use uncompressed HDR color (RGBA16/32) (potentially a lot of memory).
    - Use MonoSH instead of a standard directional map (if you're using any directional data at all), then the alpha channel is free.
    In any case, you can bake with e.g. AO intensity = 0.0001 and then grab the actual separate AO map via a script. I have an example script here:
    This one just saves each AO map as a separate file along with other lightmaps, but you can extend it.

    Woah, interesting. Can you reproduce it with this object alone in a separate scene? Is there anything unusual about this object? Can you send some little test package to me to test it?

    Ah, yes, you've emailed it to me.
    Turns out, the IES parser had a problem with weird line break format in the file. I've just fixed it, so it parses correctly. Can you try the latest patch?

    Ouch, is it with "Hole Filling" enabled or not? Does it work without it? Can it be reproduced on a small-ish scene?

    I suspect you see a lot of blue-ish sky specular and nothing else? This is probably because the default HDPR Sky intensity is extremely high, and your lights (if you're converting from non-HDRP) are very dim in comparison.
    I have a little guide about my example scene HDRP conversion, which is applicable to other scenes as well:


    In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.

    ...or vice versa, increase your lights' intensity to values typically used in HDRP scenes (you can check their examples for reference, they like setting sun to 10000, for example).

    ...ok, then seems like you did it already.

    I actually have no idea what is even this normalization data. Apparently it doesn't exist in other render pipelines. Perhaps it didn't exist in HDRP before too.
    Can you send me any small test project to debug it?

    You need to use the Shadowmask mode and set your Bakery Direct Light to "Shadowmask and Indirect":

    I'm not aware of a HDRP-specific tutorial (and I'm not a big HDRP user myself), but perhaps you can ask people's experience on Discord?

    Attached Files:

  26. The_Heavynator


    Jan 22, 2018
    ya know.. i realy should have just tried the patcher since the last time I had a big issue it was with the denoiser and there was a fix for it, though it was working in the previous unity version so thats probably why it never occoured to me.
    either way, thanks.
    guycalledfrank likes this.
  27. Enverex


    Jul 6, 2019
    This is with Hole Filling enabled. It seems OK without it, but then of course you lose a lot of lightmap space. I've not managed to recreate it on smaller scenes.
  28. guycalledfrank


    May 13, 2013
    Today I found some issue with hole filling sometimes being corrupted by the presence of objects with "scale in lightmap" = 0 or "receive GI" = probes. Fixed it, can you try the latest patch?
  29. Enverex


    Jul 6, 2019
    I use scale in lightmap = 0 extensively so that could be the cause. Will try tomorrow and report back.
    guycalledfrank likes this.
  30. Enverex


    Jul 6, 2019
    So this... mostly seems fixed? There's no blatant overlaying now, but I did end up with a few rare instances where they'd overlap slightly (not bleed, but actually overlay the UVs slightly but just a little, rather than completely). Rebaking seemed to fix it and it made better choices subsequent times but it's odd that it still happened.
    guycalledfrank likes this.
  31. JasonB


    Dec 29, 2010
    Well, I've tried all weekend myself to no avail so I figured I'd seek some help.

    Is there anyone who has had luck turning any of these shader graphs meant for static geometry (so like, URPBakerySHSpecGraph specifically is what I'm working on) accept triplanar normal maps?

    I tried digging into the BakerySHSpec subgraph as well, and have tried basically every combination I can think of for feeding my triplanar mapped normals into it, and sometimes I can get almost correct results but with major errors on some surface angles.

    If someone has a definitive answer for this to end my agony, it'd be a life saver. I have a lot of large-geometry objects like skyscrapers where it makes no sense to UV unwrap them normally and need unique materials per object when I can just as easily add triplanar brick or something. I have the other maps working as triplanar, but the normal is troublesome (probably due to all the custom functions it runs through).

    Second issue I've been having, unrelated. Using URPVolumeSpecGraph, I noticed changing my materials metallic makes them... well, way too bright or visible when in dark areas. It just seems metallic surfaces react incorrectly with the volume lighting compared to non-metallic surfaces.

    Right now I'm sort of mitigating it by dropping the color multiplier down to a dark gray instead of white but it seems wrong to have to do that. Even "white" albedo metal shouldn't be that bright in the dark I shouldn't think. I could be wrong.
    Last edited: Dec 24, 2023
  32. Zenchuck


    Jun 2, 2010
    I am a few years late to the party. Not understanding how atlasing works. Any way to force everything onto a single lightmap?
  33. nyirdrone


    May 8, 2020
    How can I remove these colored spots? Bakery.jpg Bakery2.jpg
  34. RPGia


    Jan 23, 2017
    Where are the per-scene Bakery settings saved/serialized? For part of my scene processing, I import another scene and copy objects from it. Whenever I do this, it seems to reset the Bakery settings, so I need to manually adjust the settings every time. I'm hoping to automate setting my Bakery settings via script, so that I don't need to do by hand. Is there an API for this?
  35. Enverex


    Jul 6, 2019
    That's what the lightmap group component is for.
    guycalledfrank likes this.
  36. hrindr_unity


    Dec 9, 2022
    banding.jpg Hi there! I am having badnding issues, I have tried change settings, baking on 4096, changing in denoiser but the problems persists. Please help.
  37. guycalledfrank


    May 13, 2013
    Happy holidays (if you... have them) :)

    This year I didn't release a new store update. Should I? The reasons are:

    1. Weird store policies:
    "New assets must use Unity version 2021.3 LTS or newer". There are a lot of users on 2019! So for a new user on an old Unity I need to choose between them facing "ur Unity is old, go update" on the store or downloading the current version instead, and then updating it with my built-in patcher. I chose the latter. Bakery still supports even 5.6 (!).

    2. There are no significant features added. Bakery works. It's ok :D There are many fixes and improvements on the github/patched version that I added over the year though (to recap):

    - Added LightMesh batching (performance improvement).
    - Added Light Probe baking ability for BakerySectors.
    - Added Direct Light texture projection viewport controls.
    - Added OpenImageDenoise2 (GPU) support. Best denoising option in terms of quality/performance/stability right now IMHO.
    - Added a workaround for the infamous "Unity reimports the whole project" bug (of Unity).
    - Added selected object highlighting to Atlas Preview.
    - Fixed area lights captured by legacy Light Probes.
    - Fixed incorrect Meta Pass output on objects with per-vertex or "scale in lightmap = 0" objects.
    - Fixed lighting data asset application order in 2021+.
    - Fixed benchmark issues when project files are marked as read-only.
    - Fixed convex shape intersection when counting how many shadowmasked lights intersect.
    - Fixed cancel button not working when prompted about saving the scene using L1.
    - Fixed compressed volume direction.
    - Fixed BakerySectors on 2022+.
    - Fixed sectors not using _BaseMap/_BaseColorMap.
    - Fixed using *.asset files for color maps.
    - Fixed "Update Skybox Probe" on HDRP.
    - Fixed lightmap importing when "Parallel Import" is enabled in Unity (again).
    - Fixed baking SH/RNM with 0 bounces and Shadowmask.
    - Fixed RTPreview marking objects as unwrapped without actually unwrapping.
    - Fixed objects with "scale in lightmap = 0" affecting atlas packing.
    - Some UI fixes.

    So what do you think, should I release it as a store version, with that forced "2021+" new rule?

    I noticed sometimes Unity unwrapper does this within the model. So if it's inside one mesh' layout, this is the reason. Usually it's not critical.

    There are different ways to implement triplanar mapping (e.g. with or without blending, or even only sampling twice instead of 3 times), so if you can send me a unitypackage with some triplanar graphs that you're using, I can try to integrate them to the SH graph :)

    Hmm... does it happen with the latest 15.0.7 graphs from here too?
    I might've fixed something this year.

    Yes, you can put a Lightmap Group on objects to do so:
    One group is one lightmap atlas.

    These are texture compression artifacts.
    What compression are you using/what platform are you on?
    Simply disabling texture compression on lightmap assets will fix this, but lightmaps will take more memory. Increasing lightmap resolution will help, since most GPU compressed formats operate on ~4x4 texel blocks, so if there are less changes of intensity within a single 4x4 block, it will work better.
    On mobile, make sure to use ASTC instead of ETC:

    They're stored in an invisible scene object named "!ftraceLightmaps", on a ftLightmapsStorage script.
    There is an API to get it:

    If you want to copy objects from another scene along with their lightmaps, you need to merge a few arrays on the storage:

    List<Texture2D> maps;
    List<Texture2D> masks;
    List<Texture2D> dirMaps;
    List<Texture2D> rnmMaps0;
    List<Texture2D> rnmMaps1;
    List<Texture2D> rnmMaps2;
    List<int> mapsMode;

    These contain the map list for the scene. Maps is the list of your color lightmaps, masks is the corresponding same-length list of shadowmasks (zero length if they're not baked), dirMaps is the same for directional (or MonoSH) maps, rnmMaps0/1/2 contain RNM or SH maps (if any), mapsMode is only used when rnmMaps are used.

    When merging, if you want to bring new lightmaps into the scene, make sure to Add() them to these arrays.

    How do you know which renderer is using which lightmap? For this we have per-renderer properties stored:

    List<Renderer> bakedRenderers;
    List<int> bakedIDs;
    List<Vector4> bakedScaleOffset;
    List<int> bakedVertexOffset;
    List<Mesh> bakedVertexColorMesh;

    bakedRenderers is the list of all baked renderers in the scene, and all other arrays give your their properties using the same index. bakedIDs are lightmap IDs (in the storage), scaleOffset corresponds to renderer.lightmapScaleOffset and other values can be 0/null when it's not a per-vertex lightmap. Thus, to get the normal color lightmap of an object, you can do:

    maps[ bakedIDs[bakedRenderers.IndexOf(myMeshRenderer)] ]

    This way, when merging new objects, you can just Add() them to baked* arrays, except the bakedIDs value needs to point to the newly added map... and that's it! Then call ftLightmaps.RefreshFull() and check if everything is correctly lit.

    Alternatively, you can use Lightmapped Prefabs:
    They have their own storage object embedded, so you don't even need to merge.

    Ah yes, it's mobile texture compression. Mentioned above:
    Last edited: Dec 30, 2023
    Sometimes_Always_Never and RPGia like this.
  38. Sometimes_Always_Never


    Apr 5, 2014
    We have used Bakery for years to ship many store titles and adore it. It makes Unity truly beautiful, so thank you Guycalledfrank!

    But we had no idea that the patcher existed. When you have to replace every aspect of Unity it's hard to keep up to date and we only saw that the store version hadn't been updated. When we did it fixed issues we'd had for years, instantly.

    We also saw people saying that since it hadn't been updated it had been abandoned (SIGH). So there's a perception, especially those that don't follow closely, that lack of store pushes is bad.

    Personally, I think you should push the latest version to the store and require 2021 and above, while also making a note that a user could get access to a 2019/2020 repo. In many ways, invert the current approach. My two cents.
    guycalledfrank likes this.
  39. Njordy


    Mar 31, 2019

    Any idea why this keeps happening? :) I mean it's beautiful and all, buts still :)
  40. AcidArrow


    May 20, 2010
    I don't think this applies to bakery, it says afterwards:

    "Already published assets can still receive updates from Unity version 2019.4 or newer." I think Bakery counts as an already published asset.
    guycalledfrank likes this.
  41. KarlKarl2000


    Jan 25, 2016
    It'd be a shame if people think Bakery is abandoned just because there aren't updates on the asset store.

    If it means bringing more customers to Bakery, definitely push the new version to the asset store. You deserve the additional $$$ thrown your way.

    Happy new year! 3 more hours in NA.

    Here's to 2024 being a good year for devs.
  42. Game-Dragon


    Nov 16, 2012
    I agree with this 1000%. This is very important. One of the first things I do when I look at assets to purchase is check the release changelog. I do not want to purchase assets that are no longer maintained or no longer have support. Especially with how much URP/HDRP change, buying older assets tend to be very problematic. So if I see an assets that hasn't been updated in a few years on the Asset Store, that's a huge red flag for me.

    I've been using Bakery for years, so I'm aware you do most of your updates through GitHub. But I'm sure new users might not know that. The Asset Store page currently doesn't really show active updates.
  43. Njordy


    Mar 31, 2019
    Same, but with the "Latest release date" under "Add to Cart" button
    Game-Dragon likes this.
  44. PrimeDerektive


    Dec 13, 2009
    Hey @guycalledfrank! I'm doing an SH bake using the BakeryURPSHSpecGraph shadergraph, and the specular looks nice but my reflections are not looking correct. i'm testing with a simple "mirror" material, with metallic/smoothness set to 1 its just solid black, but if I dial them back to like 0.9, I see some sort of reflection but it does not look correct, and adjusting the intensity of the nearby reflection probe doesn't do anything.

    Here's what it looks like:

    Here's the same thing with the URP lit shader:

  45. NAOLIU


    Mar 15, 2021

    Attached Files:

  46. NAOLIU


    Mar 15, 2021
    I have Use Bakery/Stander and enable SH 、MonoSH in shader
  47. NAOLIU


    Mar 15, 2021
    Forgive me, this is my first time using this forum TAT
  48. NAOLIU


    Mar 15, 2021
    At the same time, I tried to improve my Texels per unit, but I found that once it was greater than 100, a serious problem occurred. After rendering, I couldn't render Light Probes and it would show that there were changes. However, I have never touched anything in my scene. After rendering, I immediately went to render Light Probes and I don't know why this error occurred
  49. guycalledfrank


    May 13, 2013
    OK, you guys convinced me I should do a new store release!

    Not really :eek:
    Do you have super tiny yet super bright emissive light sources? Or maybe similarly bright stars on a HDRI?

    SH specular is only able to represent a single properly occluded highlight, so it's okay when the surface is rough enough, but it's not enough for very glossy surfaces.
    Reflection probes, on the other hand, give you complete environmental reflection, but from a single point of view, so it remains unoccluded in dark corners, potentially giving you an "icy" look.
    Simply adding SH specular to reflection probes won't look good, as you'll keep all occlusion problems of reflection probes and just add more energy over them (potentially violating energy conservation also), so my SH specular shaders only sample the highlights. You can use other shaders that use reflection probes.

    Recently I was working on a scene from my game and had the same situation where reflection probe was too bad without any occlusion and SH was too inaccurate with just one highlight, so I tried... using boosted SH response as a mask for reflections, and it turned out surprisingly good:


    Here, I added a graph that does this:
    It's named BakeryURPSHSpecWithReflectionGraph and it has an additional "SH masking" parameter you can tweak.


    Do you have an actual bright light source inside this lamp? I'm not sure what geometry/normal/light configurations are here. If you can send me any small test unitypackage or project, I'll debug it.

    In L1 light probe mode (default) the probes are rendered together with the scene, so you don't even need to press this button.
  50. JasonB


    Dec 29, 2010
    I'm very confused, my lighting test scene has 4 bakery lights that are 100% identical, just placed differently (and hue shifted, and the green/blue ones and red/yellow ones are set to bake to their own shadowmasks), but one of them is generating a very noisy output in both the lightmap and the volume map.

    At first I erroneously thought it was because the light was green, but when changing the color it was still creating noise.

    Included an image of one of my volume maps, and the noisy surface (or the lightmap of it) too. The other lights are perfectly smooth. Super weird. Makes no sense.

    upload_2024-1-7_17-21-13.png upload_2024-1-7_17-23-44.png