Search Unity

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

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

  1. Ruuubick

    Ruuubick

    Joined:
    Apr 20, 2014
    Posts:
    15
    But it's the same error message as if i was trying to bake Selected Groups, but i'm not, i don't have any anywhere, i'm trying to use the Render option. Baking works if i attempt the absolute default settings after import, but nothing else.

    The gif shows me trying to use the Render option, but the error is the same as if i was using the Render Selected Groups option.

    Here's a gif of me going back and forth between Render and Render Selected Groups
     
    Last edited: Apr 2, 2019
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    The error is not related to Render Selected Groups. The only difference between these buttons is that Render Selected Groups performs additional filtering (by group) on top of the checks I mentioned.
     
  3. kainoo

    kainoo

    Joined:
    Aug 24, 2015
    Posts:
    9
    Yeah, I've figured out that it's due to the driver being too old. I've contacted Google about it. I will be updating this message in case I get any news.

    Thanks for the help!
     
    guycalledfrank likes this.
  4. HansBernd

    HansBernd

    Joined:
    Nov 3, 2012
    Posts:
    47
    RTX mode works now, thanks alot!
    We are seeing an about 120% speed increase :))
     
    guycalledfrank likes this.
  5. Ruuubick

    Ruuubick

    Joined:
    Apr 20, 2014
    Posts:
    15
    Hi Mr F

    This is what most of the object in my scene look like, which fit the criterias in the list you gave me. Trying to show the checker also gives me the same error message.

    I'm really not sure why it's having a fit, it worked before and i haven't touched anything else besides trying to run Unity's lightmapper once. I wouldn't be surprised if there's conflict between the two. This is also the only project i'm having this issue in, but all i have is a dozen baked lights, nothing wild IMO.

    Here's what i'm seeing in my log :
    Code (CSharp):
    1. Scene LOD levels: 0
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:Log(Object)
    6. <ExportScene>c__Iterator0:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:1934)
    7. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:3337)
    8. ftRenderLightmap:RenderLightmapUpdate() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2993)
    9. UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:127)
    10. (Filename: Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs Line: 1934)
    11.  
     
    Last edited: Apr 2, 2019
  6. Balours

    Balours

    Joined:
    Nov 27, 2013
    Posts:
    42
    Hi,

    Got this error when I'm trying to lightmap a prefab, before the prefab I was lightmapping the entire scene and it was working fine. Any ideas?
    Thank you!
    (Last version of bakery)



    In the console:
    Error: Failed to save TGA file. See console for details. (5)
    UnityEngine.Debug:Log(Object)
    <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4343)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2993)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     

    Attached Files:

  7. JoRangers

    JoRangers

    Joined:
    Nov 7, 2017
    Posts:
    21
    Hi,

    I done my bake on a prefab and all works well.

    In my project, I instantiate the prefab (with don't destroy on load) and my lightmap is displayed.
    But now, I change the scene and my lightmap has disappeared.

    I try load scene in additive or in single mode, the result is the same.

    There is a workaround for the prefab to keep the lightmap when I change the scene ?
    Can I reload the lightmap by script in runtime ?

    I use unity 2018.3.9f1 & bakery v1.55
    I want to build for Android & iOS

    Thank you for the help
     
    Last edited: Apr 3, 2019
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    OK, this is odd, I can't see any clear cause in your case. Can you send me your scene (or better, a stripped, simplified version, a single supposed-to-be-baked object would suffice) as unitypackage for debugging?

    How do you lightmap the prefab? Is it in a separate scene, or did you try the Render Selected button on it, or something else?
    The "failed to save" error usually indicates that you:
    - don't have enough disk space for the file to be written.
    - have the file already, but it's marked as read-only or being locked by another application.

    Are scenes using a different lightmapping mode? E.g. one is just a single lightmap, another using directional maps? Does it completely disappear (object is lit by the global skybox probe instead of the ligthtmap) or gets super bright or something else?

    You can, but it happens anyway in Awake/Start functions of the ftLightmapsStorage script which is on the BakeryPrefabLightmapData object inside the prefab.
     
  9. JoRangers

    JoRangers

    Joined:
    Nov 7, 2017
    Posts:
    21
    Thank you for the answer

    What do you mean by lightmapping mode in scene ? is it inside bakery or in the unity lighting scene window ?

    All prefabs were baked in differents scenes with the same lighting setup (unity scene lighting window) and the same bakery setup.

    But in my app, I have others scenes with unity default lighting settings.

    On the editor, if I load my prefab after the scene is loaded, the prefab has the lightmap.
    But in build on android, I don't have the lightmap for my prefab

    EDIT
    I found a strange solution.
    To understand, in my prefab, I have a directionnal light (Mode Mixed, No shadow).
    Here are the steps of my solution :
    1) I disable the directionnal light
    2) I do a build and on my smartphone, my prefab looks very dark
    3) I activate the directionnal light
    4) I do a build and my prefab has the lightmaps
     
    Last edited: Apr 3, 2019
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    The render and directional modes in Bakery window.

    Sounds good then.

    Just to make sure, are you using the Lightmapped Prefab component on your prefabs?

    Are you using the Shadowmask mode? If so, is each prefab baked with its own directional light? Or is the directional light completely unshadowed? That would probably break any benefits of using the lightmaps though?
     
  11. JoRangers

    JoRangers

    Joined:
    Nov 7, 2017
    Posts:
    21
    In the scene for the bake.
    Render mode : Full lighting
    Directionel mode : Dominant DIrection


    Yes of course

    I take a screenshot with the bakery window, light object and unity lighting window.
    This is the setup to create my lightmaps inside my "bake scene"
     

    Attached Files:

  12. Balours

    Balours

    Joined:
    Nov 27, 2013
    Posts:
    42
    My disk has plenty of space (around 100 Go).
    I tried to lightmap the prefab in a brand new separate scene, using render or render selected it's still throwing this error at 100% Progress (not the rgba2tga) :

    Code (CSharp):
    1. ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[UnityEngine.Texture2D].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    4. ftRenderLightmap+<RenderLightmapFunc>c__Iterator4.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5093)
    5. ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2993)
    6. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)
    Note that I'm on 2018.2 and the baking is still working for some prefabs.
     
    Last edited: Apr 4, 2019
  13. dylanjameswalch

    dylanjameswalch

    Joined:
    Jun 20, 2018
    Posts:
    11
    Hi there,
    I am experiencing strange blotchy looking lighting while using Point and Spot lights. Is there a known solution to this?
     

    Attached Files:

  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,573
    Hi,
    So I'm trying to get this working in a LWRP based scene. However, no matter what I do the shadow maps are all black. I've read over the documentation and note that:

    - I've added the Bakery components to my light, along with a sky object
    - There's references to options that don't exist anymore (shadow mask mode on lights)
    - There's no information about what modes have to be set in Unity's Lightmap settings and how they correspond to Bakery settings
    - It seems like setting up groups is now required? I dumped all my objects into a group but did not see a difference.
    - I've tried a number of combinations of options in the bakery settings and unity settings, but nothing seems to work.

    I'm running on a 980ti in Unity 2018.3.11f1 and the baking process seems to run fine, throws no errors, etc..
     
  15. Journeythedev

    Journeythedev

    Joined:
    Oct 19, 2016
    Posts:
    16
    Hi I was using Bakery fine up until today and now I get ftrace error 91 whenever I try and bake.
     
  16. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    7
    Hello,
    Bakery presence seems to set my lighting settings to mixed in run time, while i need some scenes to use real time GI. Is there a way to tell Bakery not to interfer ? Thanks !
     
  17. JoRangers

    JoRangers

    Joined:
    Nov 7, 2017
    Posts:
    21
    Hi,

    I continue my test about my issue from my post here :
    https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-55-released.536008/page-54#post-4388017


    I found another solution with 100% succes :

    Perhaps, it can help you to debug and/or improve bakery

    1) I put the prefab inside one of my scene (not the scene for renderer the lightmap)
    2) I go to lighting panel scene of unity
    3) I check Auto Generate. Normaly, the lightmap disappear
    4) I delete the prefab
    5) I put again the prefab inside the scene
    6) I delete the prefab
    7) I save the scene
    8) I do a build and it works on Android & iOS


    I think there are some conflicts with unity lighting scene & your bakery settings.
    When I put the prefab in the scene, I see the prefab modify the unity lighting scene at "runtime".
    Any idea ?

    What is your recommendations to setup the unity scene lighting windows to works well with bakery ?

    In attachments, you can see :
    Capture_lighting_unity.png -> this is my unity lighting setup for my scene
    Capture_lighting_unity_2.png -> this is the result of the unity lighting scene when it works (above step 8)

    Thank you for the help
     

    Attached Files:

  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Are you on the latest github patch? If not, can you try it? If yes, can you send me this prefab as unitypackage as well?

    Caused by low-quality compression Unity applies to lightmaps on mobile projects. Quoting myself from an old post:

    The lightmaps?

    Don't exist in LWRP you mean?

    Unity Lighting settings don't matter and will be overridden by Bakery anyway.

    No, definitely not.

    Can you make sure that you can bake a single directional light in Full Lighting mode, without any GI (bounces=0)? I wonder if something goes wrong at the GI stage.

    Make sure you have enough free disk space, I guess.

    As mentioned, Bakery overrides these global settings. Mixed is enabled if you baked in Shadowmask mode.
    If you bake with "combine with Enlighten" checkbox, it should also always enable it as well.
    If you just want to hack your own settings in, take a look at ftLightmaps.cs, this is the script that sets the stuff (search for "Lightmapping.realtimeGI = storage.usesRealtimeGI;")

    This is the correct behaviour, yes.

    You don't have to.

    This is very puzzling. Again, if you can provide me any project/unitypackage where it can be reproduced, I'll take a look. Note that I don't have any physical Android device though.
     
    JoRangers and Journeythedev like this.
  19. Dawie3565

    Dawie3565

    Joined:
    Dec 30, 2018
    Posts:
    60

    dylan
    as frank indicated its Caused by low-quality compression Unity applies.. mainly the pesky banding bug is a complete lack of dither applied by unity when the texture imports .. I suggest you check GitHub and search for subject Unity texture dithering

    if some one has a good link for a tested script custom texture 16bit importer that adds dither pre quantization, please link

    Frank
    on a similar subject what is that unity bug that the UV padding cant be adjusted correctly with out switching the index format to 16bit? pros and cons not certain
     
    guycalledfrank likes this.
  20. Journeythedev

    Journeythedev

    Joined:
    Oct 19, 2016
    Posts:
    16
    I moved the temp path and still got the same error.
     
  21. Dawie3565

    Dawie3565

    Joined:
    Dec 30, 2018
    Posts:
    60

    so just a bit of follow up about the Unity UV padding Bug and 16bit Index format
    1. the History
    I looked back on the history of the mesh that the bug appeared in , it was a array of rocks that I generated to make a future Occlusion buffer in a area , the rocks where combined into a ACSII format and exported from Unity converted back into Binary and imported blender, exported in a common 2013 FBX format and re imported to Unity 2017+ as in it permitted a tris count over 75,000 … the FBX was added in scene and made into a prefab for convenience and consistency with project

    2. the bug
    the UV padding warning appeared during first bake, switched to 16bit cleared the bug however as it was such a large array with high tris the 16 bit index cant go over about 75,000 tris without breaking the mesh to below about 50,000 some notable quality loss and more drawcall … I switched 16bit index back again to 2017+ and amazingly the Bug remained cleared in the following bake, so I am thinking about what influence may happen in Unity during the prefab generation that affects padding .. it so random and hard to reproduce

    hope xatlas will help :)
     
    Last edited: Apr 5, 2019
    guycalledfrank likes this.
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Calling Unwrapping.GenerateSecondaryUVSet on 32-bit meshes completely messes them up, creating an incorrect index buffer (triangles pointing to wrong vertices).

    Does the error happen if you try baking example (or any other) scenes as well?

    It will! xatlas doesn't have a problem with 32-bit indices.
     
    Dawie3565 likes this.
  23. Kolgrima

    Kolgrima

    Joined:
    Feb 2, 2009
    Posts:
    36
    I seem to be getting this issue as well... I'm on version v1.551 of the asset and Unity 2018.3.9f1
     

    Attached Files:

  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Did you try the Update Skybox Probe button?
     
  25. Kolgrima

    Kolgrima

    Joined:
    Feb 2, 2009
    Posts:
    36
    Yes, I did try that, but it didn't help.
     
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    OK, a little check:
    - Open ftLightmaps.cs
    - Find this comment:
    // default bugged probes are [almost] black or 1302?

    - Below it, add this line:
    Debug.Log("SH: " + probe[i,j]);

    - Reopen the scene
    - Let me see all the "SH:" lines printed to the console.
     
  27. Dawie3565

    Dawie3565

    Joined:
    Dec 30, 2018
    Posts:
    60

    just a tip perhaps it may help I had this issue before when I tried to use a lower quality six sided skybox , I changed to a cube map type and fixed the issue
     
  28. Sanyol

    Sanyol

    Joined:
    Jan 28, 2013
    Posts:
    18
    Hello @guycalledfrank ,
    is it possible to bake the lightmap during runtime (In the working PC build) ?
     
    DebugLogWarning likes this.
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    No, unfortunately Bakery is not designed for that. For example, scripts are using Unity asset API, which is not available at runtime (texture import/compression).
    Well, the core lightmapping part is standalone, so nothing prevents you from using it even at runtime, but that would require a totally different approach to scene export/lightmap import.
     
  30. Sanyol

    Sanyol

    Joined:
    Jan 28, 2013
    Posts:
    18
    I expected that :) Thanks for the answer!
     
  31. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    182
    is it safe to check GameObject gg for null at around line 1076 in ftBuildGraphics.cs ?
    ex:
    Code (CSharp):
    1. var gg = ftLightmaps.FindInScene("!ftraceLightmaps", scene);
    2. if (gg == null) continue;
    we're having a case where with multiple scenes Bakery will error out when trying to view UV checkers if gg is null there. It seems like adding a null check doesn't cause issue (it just continues the for loop if null)
     
    guycalledfrank likes this.
  32. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    It should be. Although I'm not sure why would that happen, since render/checker should initialize this object in all scenes... will investigate.
     
  33. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    844
    Just bought an RTX2080, could you let me know specifically what bakery can do with this card specifically?
     
  34. Journeythedev

    Journeythedev

    Joined:
    Oct 19, 2016
    Posts:
    16

    No it doesn't happen for other scenes. I'll move the assets over to a blank scene and try and let you know.
     
  35. sahana_vr

    sahana_vr

    Joined:
    Jun 21, 2013
    Posts:
    2
    First off, great plug-in, a lot of hard work.

    I am having an issue with one of my scenes. There is an object in my scene that just happens to be glowing. Everything else is fine in the scene. The Neon sign, door and window have emissive light textures. The glowing object, which is a cup does not have an emissive light texture. Is there a reason why some objects glow at times?
    The cup is part of a prefab group that has A Bakery Lightmap Group Selector script attached to it. The Root Prefab has a Bakery Lightmapped Prefab script attached to it with the Reflection Probe embedded into the Prefab as well.

    Sahana

    Glowing object
    2019-04-10_08h33_33.png

    Settings
    2019-04-10_08h34_50.png
     
    guycalledfrank likes this.
  36. Kolgrima

    Kolgrima

    Joined:
    Feb 2, 2009
    Posts:
    36
    I get One thing plus a warning;

    Lighting data asset ‘Realm_371857150_probes’ is incompatible with the current Unity version. Please use Generate Lighting to rebuild the lighting data. Realtime Global Illumination cannot be used until the lighting data is rebuilt.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    SH: 3.202841E-39
    UnityEngine.Debug:Log(Object)
    ftLightmaps:RefreshScene(Scene, ftLightmapsStorage, Boolean) (at Assets/Bakery/ftLightmaps.cs:633)
    ftLightmapsStorage:Awake() (at Assets/Bakery/ftLightmapsStorage.cs:183)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
    guycalledfrank likes this.
  37. Lt-Hamster

    Lt-Hamster

    Joined:
    Feb 19, 2013
    Posts:
    2
    Hello,
    I seem to be running into an issue.
    Whenever I bake objects that are children of anything and they don't have Unity's 'Generate Lightmap UVs' checked, they all seem to share the same UV space in the lightmap. I can pull the same object out of the empty gameobject parent, re-bake, and it looks fine.

    Quick test scene I mocked up.

    BakeryTestScreenshot.PNG
    Highlighted objects are in the empty gameobject and are using the wrong lightmap UVs.

    Thanks for all you do!
     
  38. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Same as without but faster. Make sure you enable the RTX mode checkbox.

    Ahh. I hear about this bug from time to time, but so far it was very elusive and hard to reproduce. What might help is increasing the resolution on this particular object (mesh renderer -> scale in lightmap).

    The warning is okay. The debug text indicates that the ambient probe was in fact updated... not sure why it looks like it didn't. If you just call
    DynamicGI.UpdateEnvironment()
    in some script, will it fix it?

    Do these objects come from a single model or different? Does every mesh has its own hand-made UV set separate from other meshes? Are any Lightmap Groups (the component) used?
    Basically Bakery can overlay UVs without packing them as rectangles in 2 cases:
    - There is a Lightmap Group on the parent and the mode is set to Original UVs.
    - The children are all a part of one model and they were found to be non-overlapping.
     
  39. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    40
    Hey Frank!

    One of our artists is having trouble making lightmaps, could you give me a hand?
    Every time he tries baking a scene he's getting these messages. (He has a GeForce 1060 3gb) he also has enough space on his hard drive so it's not a space issue. Unity is also crashing sometimes when he tries baking it!

    EDIT: I did a quick search on this thread and found out the issue was a bad character in the path naming. Because he's using Brazilian Windows, the chance of this happening is enormous since our language uses lots of accents. Would it be possible to implement a fix or at least give a better warning when this happens like "Bakery has found an invalid path, please make sure there's no crazy characters in the path naming"

    image.png

    image.png
     
    guycalledfrank likes this.
  40. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    45
    Getting this error: upload_2019-4-10_18-26-45.png

    Any help would be appreciated!
     
  41. Source-technology

    Source-technology

    Joined:
    Dec 2, 2016
    Posts:
    18
    We found a bug that could be caused by the "Enable Lightmap Specular" feature in the Barkey Shader.

    Here it is: When TheMaterial is too smooth, and select Full Lighting mode, Choise Dominant Directional / RNM / SH. And turn on "Enable Lightmap Specular".

    Then , There will be a strange highlight in the shadow, especially when camera is facing it.

    The effect is shown


    The setting

    2.jpg

    The project file
     

    Attached Files:

  42. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Oops. Yeah, I have to fix it for the next release.

    I suspect this one is fixed in the github version, so please PM me your invoice number + github username and I'll add you to Bakery repositories with latest patches (eventually it'll reach the store version of course).

    Baked specular is approximate and its behaviour is imprecise by design, that's all I can do with this amount of data. The shadowed part is illuminated by the ambient light, which happens to come from all directions, yet lightmap specular has to approximate it as single direction.
    For dominant direction, I might be able to fix it though... needs some experimenting.
     
  43. motioncapture

    motioncapture

    Joined:
    Jul 23, 2018
    Posts:
    2
    The following error occurs. Please let me know how to fix it.

    NullReferenceException: Object reference not set to an instance of an object
    ftLightmaps.RefreshScene (Scene scene, .ftLightmapsStorage storage, Boolean updateNonBaked) (at Assets/Bakery/ftLightmaps.cs:747)
    ftLightmapsStorage.Awake () (at Assets/Bakery/ftLightmapsStorage.cs:183)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  44. Source-technology

    Source-technology

    Joined:
    Dec 2, 2016
    Posts:
    18

    NOOOO... YOU CAN DO IT!!

    JUST DO IT!!


     
    guycalledfrank likes this.
  45. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Hmm. Did you bake anything in shadowmask mode and then deleted the lights? Might require a rebake. I'll have to fix it soon.
     
  46. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    182
    that's just a limitation of approximated specular, this pdf has more information & possible workarounds ( page 77 ) https://media.contentapi.ea.com/con...-precomputedgiobalilluminationinfrostbite.pdf
     
    guycalledfrank likes this.
  47. sahana_vr

    sahana_vr

    Joined:
    Jun 21, 2013
    Posts:
    2
    I get this Error when I am baking several Prefabs. Not all of my Prefabs get the Bake data attached to it. Any ideas? There are a few Prefabs that are not getting patched as well.
     

    Attached Files:

    Last edited: Apr 12, 2019
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    844
    Still doesnt work for me, i get "null tex ptr", "null emission tex ptr" and in console it just says "Error exporting scene - see console for details". Amazed there are no proper error messages yet, can you add some ?
     
  49. AlperGonen

    AlperGonen

    Joined:
    Apr 10, 2019
    Posts:
    4
    Hi, I just purchased this asset after none of the unity's lightmapper can render my huge scene. But, this couldn't solve the issue also. After sometime in the exporting scene step, I got a "too many heap sections" error or errors and then unity crashes. I am attaching log files. Please help I am at the end of the development and I don't want to spend more time for light baking...
     

    Attached Files:

  50. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,073
    Please try the github patch.

    Are you on DX11 mode of editor? Is there <DX11> in window header?
    This error is not supposed to happen at any time, so no proper error message. Basically Unity returns null for GetNativeTexturePtr for an unknown reason (it never should - docs don't mention it). My observations tell me it can happen if the texture was unloaded from VRAM, but Bakery forces it to load back before calling this function.
    If it keeps happening, we should get someone from Unity to this thread, but it's very likely related to you being out of VRAM before the bake even started.

    Seems like Unity can't allocate enough RAM (not VRAM) to run Bakery scene export scripts (or its own lightmappers). You should definitely try optimizing/simplifying your scene or getting more RAM before baking. Maybe it's also possible to bake it in parts.
    Also if you have lots of painted terrain trees, those might take a lot of memory. There is a flag to omit them from baking if that's the case.