Search Unity

Bakery - GPU Lightmapper (v1.65) [RELEASED]

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

  1. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    There is no quality difference between legacy and non-legacy denoisers. The only difference is that the new one is compatible with newer drivers.

    Yep. I'd mention it in the wiki if they were supported.

    I answered you here: https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-65-released.536008/page-74#post-5234969

    Yes. I was under the impression it's integrated into Unity now, but it seems you need to download the package first.

    2019.3 beta I guess?
     
    xinuxano and xVergilx like this.
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    I don't think it works any different to Unity's constant ambient factor that does get added on top as well. You can decrease sun lighting to avoid overexposure.

    Try decreasing the value?

    "Outer" shadows are from the sun, "inner" are from skylight.

    My PBR heart is gonna break, but you can delete skylight and just use sun direct + multiple fake ambient directs.
     
  3. Sapler

    Sapler

    Joined:
    Apr 27, 2019
    Posts:
    5
    Ok tried the generate lightmap UV no difference.. If i move the mesh with the light baked on it or the lights the "light" is stuck onto the object as it should? Still no clue what I could be doing wrong at this point. Might just need to wait with bakery again until I start a new project and start with bakery from the get go..
     
  4. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    530
    Just let you know that I did a bake in 2019.3 b12 without aparent issues other than the messed up ui. For wome reasong hwen upgrading the project messed up all the lightmaps
     
    guycalledfrank likes this.
  5. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    530
    Clear lightmap data option resets the settings in the render panel, its very annoying. This has been happening for a while still ahppening in last version.
    If this is not an spected behaviour clear baked data with the render inspector closed, when you reopen, settings are reset
     
  6. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Well it still brightens everything, just less. I wouldn't want any direct or indirect lighting brightened anymore than it needs to be. I just want to reduce shadow strength while not messing with anything else.

    I suppose my question should just be - Is there a way to reduce shadow strength without changing anything else?
    Thanks, ill try that!

    Edit: That solved the addictive shadows, thanks!
     
    Last edited: Dec 4, 2019
    guycalledfrank likes this.
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    246
    Please excuse my newbie ignorance. This plugin looks awesome, but with the new native GPU Progressive Lightmapper, is there still a need for Bakery?

    I don't have much experience with either, just want to understand where to invest my effort (and possibly cash)
    I work on mainly large scale AEC projects (and coming from an offline rendering background)
     
  8. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Crashes in decent size scenes. CPU one takes ages.

    And it won't be fixed until after 2020.x cycle (at best).

    Bakery is a godsend for large scenes.
     
    guycalledfrank and newguy123 like this.
  9. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    246
    I've noticed that with the native GPU lightmapper, I can't exclude objects from casting shadows

    Can I exclude some objects from casting shadows if I use Bakery?
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    You're likely missing something simple - try re-reading the manual or go to discord and ask around.

    Can happen (with built-in baking as well), as Unity unwrapper changes from version to version and can produce different results on asset reimport.

    ... I know. Will fix!

    I guess you can try the built-in one first and see if you encounter any problems. AFAIK, GPU progressive still has many feature limitations at the moment:

    upload_2019-12-5_11-43-42.png

    Progressive also doesn't unload the scene before rendering, so there is a higher chance of going out of memory. But if it does what you need, use it?

    Bakery respects the "cast shadows" option.
     
    newguy123 likes this.
  11. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    66
    Is it possible, that after baking, _LightColor0 wil suddenly go black?

    Code (CSharp):
    1. Shader "Unlit/NewUnlitShader"
    2. {
    3.     SubShader
    4.     {
    5.         Tags { "RenderType"="Opaque" "LightMode" = "ForwardBase" }
    6.         LOD 100
    7.  
    8.         Pass
    9.         {
    10.             CGPROGRAM
    11.             #pragma vertex vert
    12.             #pragma fragment frag
    13.  
    14.             #include "UnityCG.cginc"
    15.             #include "UnityLightingCommon.cginc" // for _LightColor0
    16.  
    17.             struct appdata
    18.             {
    19.                 float4 vertex : POSITION;
    20.             };
    21.  
    22.             struct v2f
    23.             {
    24.                 float4 vertex : SV_POSITION;
    25.             };
    26.  
    27.             v2f vert (appdata v)
    28.             {
    29.                 v2f o;
    30.                 o.vertex = UnityObjectToClipPos(v.vertex);
    31.                 return o;
    32.             }
    33.  
    34.             fixed4 frag (v2f i) : SV_Target
    35.             {
    36.                 return _LightColor0;
    37.             }
    38.             ENDCG
    39.         }
    40.     }
    41. }
    42.  
     
  12. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    530
    while the bake in 2019.3 is correct, I've the feeling that in scene view, when you set to see ligthmaps they don´t show up, .
     
  13. Caliga

    Caliga

    Joined:
    Jan 14, 2018
    Posts:
    3
    I've encountered an issue in Unity 2017.4.28f1 (both my project and a fresh one) where Going to "Bakery > Render lightmap..." does not bring up the GUI window, unfortunately I have to use this version of Unity as I'm building a world for VRChat, has anyone else encountered the same issue? No errors appear in the console.
     
  14. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    246
    Another 2 quick newbie questions please:

    1 - Can I use bakery with HDRP and the experimental DXR? (realtime raytracing)
    2 - Can I use bakery to bake lighting into a prefab that is not present in scene, but only instantiated and placed at runtime (as in a prefab that is placed with AR Foundation at runtime)?
     
  15. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Has anyone used these LOD lightmap scripts with Bakery? https://github.com/laurenth-unity/LODLightmapScripts

    The current Bakery prefab support seems to not support unapplied changes to the prefabs, so this becomes a problem for things like modular rocks/cliff which will not always be at 1,1,1 scale for variation reasons.

    Just looking to copy the lightmap from the LOD 0 of the prefab onto the rest of the LOD levels.

    The Github project I linked works perfect & hassle free in scene view, however upon playing/runtime the LODs lose their lightmaps.
     
  16. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    66
    We are using similar StealLightmap principle with no problem. Just set your script in the ScriptExecutionOrder somewhere below the DefaultTime, because I've found out, that Bakery is resetting the parameters, so it overrides StealLightmap .
     
    deverolirc likes this.
  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    Were you baking in Full Lighting mode? If so, LightBakingOutput.isBaked is set to true after baking, effectively disabling realtime contribution from this light. It will remain in Indirect or Shadowmask mode (or if the realtime light is on a separate gameobject).

    Scene view lightmap preview doesn't work for externally generated lightmaps for some reason. The best way to check would be to just temporarily apply a white material I think.

    Extremely weird. 2017.4 is good and tested. The only reason I know is having script compilation errors. Any single script failing to compile can cause other scripts in the project not compile as well.
    Maybe the window is also just... outside of the screen? E.g. maybe you were using a wider screen/multiple screens and left the window where you can't see it anymore?
    Any non-error console messages related to Bakery?

    Not tested. Maybe?

    Yes, see https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmapped_Prefab
    There are two example scenes included for demonstration.

    @keeponshading did, I think :)
     
    sewy likes this.
  18. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Thank you! Will try this
     
  19. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    481
    Yes. I baked lots of megascan assets. Bake LOD0 and use this Lightmap on LOD1 toLOD3.
    There was some static batching issues. It must be disabled in some projects. But it was 12 months ago.
    But in general it worked.

    You can fast test it in Fontainebleau on one or two rocks with bakery group. Only bake one rock.
    I will try next week because it need it too.
     
  20. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    530
    Ok, so may be, when you implement your separate windows preview/render thing, you may add an option, as the geometry is loaded to swap the info in there with the baked lightmap material, rather than swapping white material on the scene geometry at the risk of messing up something
     
  21. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    66
    Yes, my bad, my saved settings changed and supposed to be in Shadowmask mode. Thanks
     
    guycalledfrank likes this.
  22. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    19
    Having tried both, Bakery produces much nicer looking results and has more options. Also, if Bakery fails then just Bakery fails. When the Unity lightmappers fail, they tend to (silently) crash the entire of Unity.
     
    guycalledfrank likes this.
  23. Caliga

    Caliga

    Joined:
    Jan 14, 2018
    Posts:
    3
    EDIT: I just sorted the issue, but will leave the below for posterity. I switched the window layout to 4 split, and the bakery window popped into view on another monitor. I moved it back, then reset to default. Thanks for your help!!

    It's possible about the window position, the main Unity window does lose focus as if it's opened a sub window, however I cannot see it. Steps I have tried since myt last post:

    1. Window > Layouts > Reset factory settings...
    2. Uninstalling Unity 2017.4.28f1
    3. Uninstalling Unity Hub, and any othet Unity versions
    4. Reinstalling Unity 2017.4.28f1
    5. Reinstalling Unity Hub, locating the new Unity install, and reopening the project
    6. Re-importing Bakery - which gives the following warnings taken from the debug log:

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(1180,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(1189,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5133,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5142,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5152,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5230,12): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(115,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(340,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(675,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(708,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'

    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(4843,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(5199,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    Assets/Editor/x64/Bakery/scripts/ftUVGBufferGen.cs(206,22): warning CS0219: The variable `isLWRP' is assigned but its value is never used

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(1180,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 1180)

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(1189,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 1189)

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5133,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 5133)

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5142,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 5142)

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5152,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 5152)

    Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs(5230,12): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 5230)

    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(115,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs Line: 115)

    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(340,16): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs Line: 340)

    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(675,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs Line: 675)

    Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs(708,20): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs Line: 708)

    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(4843,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs Line: 4843)

    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(5199,24): warning CS0618: `UnityEngine.GL.IssuePluginEvent(int)' is obsolete: `IssuePluginEvent(eventID) is deprecated. Use IssuePluginEvent(callback, eventID) instead.'
    (Filename: Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs Line: 5199)

    Assets/Editor/x64/Bakery/scripts/ftUVGBufferGen.cs(206,22): warning CS0219: The variable `isLWRP' is assigned but its value is never used
    (Filename: Assets/Editor/x64/Bakery/scripts/ftUVGBufferGen.cs Line: 206)
     
    Last edited: Dec 6, 2019
    guycalledfrank likes this.
  24. Lt-Hamster

    Lt-Hamster

    Joined:
    Feb 19, 2013
    Posts:
    6
    Hello!
    Running into a bit of a problem. When we bake on one computer and commit to another, many of our objects have messed up bakes. There was an error that popped complaining about the modelimporter on line 57. Forgive me but I didn't copy the actual error text and I've been having trouble recreating the error. If I get it i'll update. We've followed your rules on what to commit and what not to commit on your FAQ. The objects can many times be cleaned up by reimporting the meshes, but that won't work if we're trying to use Unity's Cloudbuild. I put a simple screenshot comparison at the bottom if that helps. Bakery Error.PNG
    Capture.gif
     
  25. stevenx

    stevenx

    Joined:
    Jun 7, 2015
    Posts:
    6
    1.if "Optimize Mesh Data" is enable, pre-instantiated prefab works fine on iPhone, but the same prefab instantiated during runtime doesn't.
    2.When "Optimize Mesh Data" is disabled, prefab instantiated at runtime works well, problem solved.

    Thanks so much!

    BTW, it seems like when I have too many gameobjects inside a prefab, sometimes it still doesn't work randomly, this even happened on my windows PC & Macbook. I couldn't locate what actually caused this problem, but after combining many meshes into one place, the UV messed up problem usually disappear.
     
    guycalledfrank likes this.
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    Checker preview should also show you baked lightmaps on top of the checker (but it's not fully visible, as it's blended together).

    Can you try alternative solution?

    ... interesting. Would be nice to find a way to reproduce it.
     
  27. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Hmm, why does increasing samples from 16 to 32 causes lights to become green?
    32_samples.PNG 16_samples.PNG
     
  28. Lt-Hamster

    Lt-Hamster

    Joined:
    Feb 19, 2013
    Posts:
    6
    Hi Frank, gave the alternative solution a try, but it won't generate the _padding.assets. It just messages "no changes detected." I found the models might need to be added to the Modifed Asset Path list, but not having any luck finding how they get added to that list. Do we need to bake with the "Adjust UV Padding" option on in the Bakery settings?
    Thanks for your help so far.
     
  29. Lt-Hamster

    Lt-Hamster

    Joined:
    Feb 19, 2013
    Posts:
    6
    Update: Baked with Adjust UV Padding checked and was able to get many assets into the Modifed Asset Path list. However when I commited those over, the other computer still had some problems with gameobjects that had the _padding.asset. They also received a bunch of the errors I was mentioning in the first post:

    InvalidCastException: Cannot cast from source type to destination type. ftModelPostProcessor.OnPostprocessModel (UnityEngine.GameObject g) (at Assets/Editor/x64/Bakery/scripts/ftModelPostProcessor.cs:70) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.AttributeHelper.InvokeMemberIfAvailable (System.Object target, System.String methodName, System.Object[] args) (at C:/buildslave/unity/build/Editor/Mono/AttributeHelper.cs:171) UnityEditor.AssetPostprocessingInternal.PostprocessMesh (UnityEngine.GameObject gameObject) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:256)

    Reimporting fixed some of the objects, and then using Re-adjust UV Padding seemed to fix the rest. But we wont be able do those when using cloudbuild
     
  30. MrDummy

    MrDummy

    Joined:
    May 16, 2019
    Posts:
    3
    As new user of Bakery, i try bake the world and i have problems if i want full bake the world.
    First, Indirect mode gives correct results:

    But because it casts Realtime shadows, i switch to Full Lighting mode. And then it get very wrong.

    Terrain with standard shader is fully dark, lights are extremely weakened on some objects. With default Unity baking function, i have no problems with it.
    Why Bakery make it very bad, i don't know.

    I thought mesh in lantern is problem, but it's not. It's just "extremely" weakened light and left is more bright. The new added cube with standard shader at right, barely visible, is still very dark.
    Seeing different light bounces left and right is just very strange. Have you some idea what went wrong here?
     
  31. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    That... shouldn't happen. I think I saw something similar once (some channels omitted from lightmap) when using too many samples/too complex geometry. It's as if GPU silently hits some memory limit. I'm not sure yet how to detect such cases. What's your GPU and driver version?

    Right, if you didn't bake with Adjust UV padding, then models should match already.
    It might be possible that you did bake with "Adjust" before and the changes still remain? Can you try this:
    - Get debug tools
    - Select model assets
    - Hit Bakery->Clear asset meta
    If there was a change in UVs, then my theory is correct and the UVs should then match what other machines see.

    Can only mean that somehow OnPostprocessModel is called on something that does NOT uses a ModelImporter. I'm not sure how this is possible. Do you use some custom asset importers for models? Models not coming from regular FBX/OBJ?

    Neither of these look correct. Can I see your light settings?
     
  32. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    481
    Hi.
    I did some tests with Unity 2019.3.0f1 Release candidate and HDRP 7.1.5 and 7.1.6.
    The Sponza scenes and the Lighting demo are baking like hell.

    LOD baking with baking all LOD s. HDRP Lit. fine.
    LOD baking with baking LOD 0 and copy Lightmap to all other LOD with Fontainebleau scripts. Fine.

    You could extend your demo scenarios with some LOD Rocks and Trees from Fontainebleau or Book of the Dead scenes. They are free are free to use.

    The Bakery HDRP shader is not working in 7.1.5 and 7.1.6.
    Renders pink with blocky outline.
    Would be nice if you could make it work with HDRP 7.1.6.
     
    guycalledfrank likes this.
  33. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Nvidia GTX 1050 TI / 432.00
     
  34. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    481
    Good morning.
    Do you see any change to bake here to vertex color with out breaking the posibility for gpu instancing.

    https://blenderartists.org/uploads/...19840942c5f1ebd5c77b6358d5749df_2_690x409.gif

    The scattered gras clusters i would love to bake to vertex color.
    Then i could use gpu instancer to instance the single cluster prefabs (three gras cluster prefabs) afterwards.

    This is already working and i get the same distribution in Unity i scattered in Blender with an hell of performance. (The realtime viewport in video shows less proxys and scattered gras because of an vieport optimisation enabled, distribution is like rendered view at the end).
    I only export the transformation groups with instances and replace it with the prefabs in Unity .
    Then i give the 3 cluster prefabs to the GPU Instancer Prefab Manager.
    Then Occlusion and Frustrum Culling is working out ou the box.


    But i would like to access the scatterd baked vertex colors then from gpu instanced ones?

    Here is an description for material variations.
    Jump to
    How can I Setup my Instances to have Material Variations on them?
    https://wiki.gurbu.com/index.php?title=GPU_Instancer:FAQ

    Do you think it is possible to bake to vertex color to a such buffer similar like in the description with the material variants. I cannot wrap my head around how the indirect instances could find their value in the buffer.


    Only baked gras is good gras.

    I also have the nice proxys (boxes) i could work with. But i have no idea for now how they could help.
     
    Last edited: Dec 10, 2019
  35. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Hi,

    I seem to be losing my lightprobe data when restarting the project, everything bakes correctly however upon restarting lightmaps are good, but all probes are completely black and a rebake is required.

    This only happens when baking probes/lightmaps from Bakery, when using Progressive lightprobes are work as expected after a restart.

    Any ideas?

    Unity: 2018.4 LTS
    Bakery: Not using a skylight, using the setup you recommended to combat addictive shadows.
    Lighting:
    upload_2019-12-10_16-39-37.png
    upload_2019-12-10_16-40-58.png

    Cheers

    Edit:

    Right after baking light probes finished:
    upload_2019-12-10_16-36-25.png

    After I restart the project:
    upload_2019-12-10_16-37-34.png
     
    Last edited: Dec 11, 2019
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    Like hell in a good sense or a bad sense? :)

    Yeah - it will no longer be supported. Use HDRP subgraphs instead.

    Looks good. Does it only happen on this particular scene and gets consistently reproduced? Any chance you can cause it on a small test scene?

    I tried doing vertex color for grass, but it's just too much data. I ended up baking SH lightmaps for the ground, then sampling it on the grass:

    https://twitter.com/guycalledfrank/status/1146318486358102016/photo/1

    upload_2019-12-11_14-15-29.png

    upload_2019-12-11_14-30-50.png


    Still gives you normal variation, you can even get some indirect specular, but AO needs to be either locally baked on grass meshes or screen-space.
    I do vertex-bake the trees though.

    You can, however, generate a buffer (can be even a texture) for your instances.
    Just grab additionalVertexStreams from each mesh, read the color and append values to a larger buffer. In your shader address it like color=vertexCount*worldInstanceID+vertexID.
    worldInstanceID must be global (world-space, not the currently rendered group) to match the IDs used during buffer creation, so I guess you'll need to create some additional buffer, mapping from current SV_InstanceID to the "world" one and update it every frame. But as I say, the amount of data may end up impractical. Also vertex-baking very primitive grass geometry (alpha-tested plane mass) doesn't look great as the vertices are too far apart.

    Interesting.

    1. After you finish the probe bake, can you check which Lighting Data Asset is currently used (the one seen in your Baked Lightmaps tab). Then, after the scene is reopened, can you check if it's the same asset? If it's not, does it work if you just plug the proper asset back in? Is it possible that you didn't save the scene after probe baking?

    2. I assume you do Render -> Wait -> Render Light Probes. Can you instead try:
    - In experimental settings set Light Probe Mode to L1.
    - Render -> Wait -> Done (should have probes).
     
  37. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    60
    Hi,
    I have a question.
    I am working on a relatively complex project in Unit 5.67 and unfortunately Bakery reliably crashes the project when being installed and corrupts something . The only solution is to delete Bakery and also the projects library folder, after that the project works again. Must be some severe conflict with another asset in the project, possibly a shader but only deleting shader cache does not solve it, the whole library has to be deleted to restore.

    Since I cannot send in the project or logs to Unity or anywhere else for confidentially reasons I want to try to manually copy the bare minimum files to use bakery light maps into the project , see if the project runs. and if this is the case later bake Lightmaps in a separate project with only the textures models and then copy over the results.

    My question: What are the minimum files required in a project to run Bakery lightmap data (without baking in the same project)?
     
  38. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    2,103
    Tried only once. Maybe it will bake properly next time, I'll try to make a repro if its consistent.
     
    guycalledfrank likes this.
  39. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Hey,

    So for #1, I check this everything seems to be assigned correctly & I was saving the scene. However, it seems that even if I take away the lighting data asset, or change it, no light probes in the scene change.

    In these screenshots, I have just baked lighting, the sphere is dynamic and shadowed by light probes.
    upload_2019-12-11_12-26-54.png
    When I remove the light data asset, I see no change in light probes whatsoever, also if I assign random lightingdata from other scenes, I see no change.
    upload_2019-12-11_12-27-21.png
    Also, deleting the light probe group from the scene I also see now change, not sure if both of these is expected behavior from light probes though.

    Here is the same screenshot after a restart, light probes are much darker, in some areas almost completely black.
    upload_2019-12-11_12-31-24.png

    I also checked the LightData Asset file size before and after restarting and it stays the same.

    As for #2, I tried this however the majority of my probes seem to be very bright and they do not seem to work with dynamic objects properly. Do culling probes work with this lightprobe method as well?

    Cheers

    Edit: I also made sure the correct scene is set in the LightingData Asset.
     
  40. jamesparksart

    jamesparksart

    Joined:
    Dec 1, 2017
    Posts:
    21
    Need help!!! My first time using Bakery it crashed and then DECIMATED my scene.. and messed up days of work. I saved it right before I used it and thought it would have been fine.. but now it looks aweful.
    After using Bakery:
    upload_2019-12-11_15-58-54.png

    Before:
     

    Attached Files:

    Last edited: Dec 11, 2019
  41. jamesparksart

    jamesparksart

    Joined:
    Dec 1, 2017
    Posts:
    21
  42. jamesparksart

    jamesparksart

    Joined:
    Dec 1, 2017
    Posts:
    21
    is there any way to recover the old scene? I know you could if you did not restart Unity.. I have done that before but like I said I saved it right before thinking it would be safe... I thought wrong.
     
  43. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    481

    Wow.. Thanks for the insides.
    The shots from the grass look great. Even more the female charakter. Perfect french style.)

    For potential further discussions of nature and lod bakes i did an 3h sprint to generate a package.
    You even could include the package as examples in Bakery if you like.

    I extracted everything out of the "Book of the Dead" Assets and made a cleanup.
    What´s inside.

    1) License:
    see
    License_original (from Book of the Dead asset)
    and
    License_strip ( i deleted everything not needed)

    ...are governed by the standard Unity Asset Store EULA. The customized versions of Post-processing, Render Pipeline Core and High-Definition Render Pipeline included with the project are governed by the Unity Companion License. See ThirdPartyNotices.txt inside the package for detailed licensing information about each of the code components....

    The package includes
    ====================

    - Environment art assets scanned by Quixel, coming either from the Megascans library or produced exclusively for this demo.
    - Environment art assets produced by the Demo team using photogrammetry.

    ...

    So you could include them in Bakery, resell them, whatever........
    Thanks to Unity BotD Demo Team and Quixel.


    2) A representive Nature Asset compilation

    everything has
    • LOD´s ( for bake LOD discussions.)
    • HDRP Lit (Standard Foliage Diffusion Profile)
    • HDRP PBR textures
    • corrected pivots for potential wind
    • prefabs

    • a group Nature_Cast with all prefabs ( upper row on screenshot)
    • a group Nature_Arangement with instances of the prefabs (lower arangement on screenshot )
    with
    • rocks
    • different Gras, Farn, ground cover plants
    • ground material
    I cleaned up the package for a clean use.

    Castt.JPG

    det.JPG

    I further did an cross check on 2 Bakery baked HDRP scenes.
    1h madness.


    HDRP Standard scene
    • create empty Unity 2019.3.0f1 HDRP project
    • import Bakery 1.6.5
    • import Bake_Nature.unitypackage (195MB, but worth every kB)
    and
    • hit Window/Render Pipeline/ hD Render Pipeline Wizard/ Fix All
    • hit Window/Render Pipeline/ hD Render Pipeline Wizard/ Upgrade Project Materials to High Definition Materials
    for auto fixing the Bakery scenes, finished.

    Bakery example_lights, example_sponza_day and HDRP samplescene (only added bakery scipts) bake without issues in some minutes

    1) HDRP Standard Scene Bakery + Bake_Nature.unitypackage

    Standard_Scene_Bakery.JPG

    2) Sponza Day + Bake_Nature.unitypackage

    Sponza_Scene_Bakery.JPG

    After import the package you only have to move to the position you like
    and set static what you want.

    This is only a suggestion. Do what you want with it.
    I only thought it could make further community discussions easier on a very nice shareable standard photogrammetry, LOD, HDRP, PBR asset base.

    Main intention is to increase the quality towards photorealism, possible out of the box with Bakery and Standard HDRP when it comes to nature and to discuss different solutions.
     
    Last edited: Dec 12, 2019
    guycalledfrank likes this.
  44. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    24
    Hi Frank,

    Can we use dual GPU for baking lightmaps?
    Would VRAM be accumulated if we use dual GPU?

    Sometimes we can't finish baking due to lacking of VRAM.
    We want to try to add more VRAM and bake again.

    Thanks,
    Squall
     
  45. OlliIllustrator

    OlliIllustrator

    Joined:
    Nov 1, 2013
    Posts:
    60

    What you should try is delete the Library folder of your Unity project (the complete one at the root level of your project, Unity will recreate it on launch of the project. Will take some time but often solves all kinds of problems).
    With a bit of luck this will help. If the scenefile itself is corrupted I fear only a backup restore will help, though. (Best advice for the future s to install a version Control system like Git and commit often. Btw. Git is even integrated in Visual Studio Code if you use that as Script Editor)
     
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,163
    Here is a list: https://geom.io/bakery/wiki/index.p..._who_doesn.E2.80.99t_have_Bakery_installed.3F

    Makes me think the object is lit by a global skybox probe, not the local ones. In which case, did you try Update Skybox Probe button?

    Their brightness should in line with lightmaps. What does "do not seem to work with dynamic objects" mean? What are "culling probes"?

    Bakery does not decimate scenes. But I can guess that:
    - It tried to reimport certain models with different UV settings.
    - Unity went out of memory trying to unwrap with its unwrapper.
    - Asset being reimported did not finish the import process and is now not rendered.
    You can try looking for the disappeared model asset and right click -> reimport.

    Although looking at that "recovery gameobject" I'm not sure... the only mention of it I can find is here:
    https://forum.unity.com/threads/unity-editor-crash-on-start.716690/#post-4799762

    Unity has detected a Transform component that is not assigned to a GameObject, and has created a new GameObject 'Recovery GameObject (8858458598365043761)' to contain the component.


    It seems to me that your Unity failed to save the scene and somehow messed up the file. You should probably ask Unity support for more details.

    I should visit France some day :D

    Some even say I should remove sponza, because it bloats the download size. But I can certainly advertize the download of this package and put it on the wiki. Good job!

    Performance-wise it seems there isn't a significant boost in multiGPU vs single GPU. Not sure why yet. As for VRAM accumulation it should work - but only with NVLINK: https://geom.io/bakery/wiki/index.php?title=FAQ
     
  47. jamesparksart

    jamesparksart

    Joined:
    Dec 1, 2017
    Posts:
    21
    I will try and ask unity help first if that does not pan out then I will delete the library and try that..
    Oh.. and when I mean decimated I didn't mean that it lower the poly count. I mean the actual definition of the word:
    kill, destroy, or remove a large percentage or part of. LOL.. kinda of play on words, but also meant that it destroyed my scene. :)
     
  48. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    117
    Frank lighting Data setting question that might not be a Bakery "thing" but I am sure you know the answer to. When "reading" the lightmapIndex on the Render component of a GameObject that value seems foobar when the application first runs, and "eventually" becomes "correct". Have you seen this behavior? Any idea what one can listen to or look for other than a horrible (wait for a while coroutine) to ensure than when you probe this variable the value has been properly initialized? In the editor, of course, the value looks correct the entire time, so this is frustrating.
    Note I suspect this has something to do with loading additive scenes.
     
    Last edited: Dec 13, 2019
  49. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    133
    EDIT: ok so I baked again even though the setting was missing, and afterwards I found it displayed the option properly again. So baking fixed the issue.

    missing-mode.jpg I'm having an issue where something disappeared from the bakery light components. A moment ago it let me choose a 'Baked Contribution', but after clicking on a different obj and going back, that setting is gone. See the attachment for what I'm getting, as compared to this other image from the manual:


    I tried deleting the Bakery folder and then re importing it, but that has not worked.
     
    Last edited: Dec 14, 2019
  50. RegdayNull

    RegdayNull

    Joined:
    Sep 28, 2015
    Posts:
    37
    What may produce that artifacts? Gray thing is a terrain. On MeshRenderers shadows are ok. Foliage is one-sided, but setting two-sided shadows option does not change anything. Top screen - builtin baker, botom - Bakery. Appears on Unity 2019.3.
     
unityunity