Search Unity

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

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

  1. fseraph1

    fseraph1

    Joined:
    Jul 12, 2013
    Posts:
    8
    @guycalledfrank
    we finally solved the multi-terrain seams problem, the solution is to convert Terrain Object to Mesh first ,after that we use Bakery to gen lightmap. the seams barely visible, acceptable result for production. thanks for your awesome work! Please Keep Improving, especially the network baking functionality!
     
    guycalledfrank likes this.
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Finally replacing the ever-confusing "bake to indirect" and shadowmask checkboxes with something better:

    upload_2019-3-6_14-58-53.png
     
    Last edited: Mar 6, 2019
  3. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    hi, trying to download and import from asset store, but keeping getting error "couldn't decompress package"

    any suggestions please?
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Happens when you don't have enough disk space to uncompress the package. Check if you have at least around 2 GB.
    This is not really related to Bakery, as package importing mechanism is the part of Unity.
     
  5. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    hi , ive got 135gb of free space?
     
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
  7. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    thanks for all your wonderful help, cheers
     
    guycalledfrank likes this.
  8. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    any link to download this other than from the asset store?
     
  9. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    found the download on my hard drive, tried to import it to unity project, still get the same error, "couldn't decompress package" don't have a problem with any other package?
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    I don't have any other link unfortunately. Please check the forum thread I linked - there seems to be a bunch of different causes from read/write folder rights to unusual characters in file paths.

    If nothing helps, try contacting Unity support.
     
  11. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Look for the place where the apk is being downloaded, delete it and re download. that should fix the problem.
     
    guycalledfrank and AJS654321 like this.
  12. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hi again, ok, i have a list of problems that encountered in production, and it would be great to have some insight in them.
    First, we are working in Unity 2018.3.7f1 (we updated due to the security patch) but these problem are present since unity 2018.2.

    1) Light probes baking: pressing this button does the pre-process of baking the light probes, but when is about to start, just finishes without baking the probes. Checking the box of occlusion probes and then baking again the light probes works fine, but when closing and reopening the scene the light probes values are lost.

    2) Baked lightmaps are not being synched using collab, upon further research we found that the lighting data asset is not being created during the render process, thus not being assigned to the baked lightmaps upload_2019-3-6_14-50-47.png

    We are using the "use scene named output path" option and we confirmed in taht folder that the lighting data asset its not there BUT baking the light probes ( as described above) creates the Lighting data asset, but still is not being assigned and even doing manual assign is not working.

    When another computer pulls the scene after doing the process described before, instead of assigning the texture of the baking with bakery, assign the texture created when the light probes were baked.

    In the next picture, the 3 files in the top row are the ones created during the light probes baking process, the one in the bottom is the bakery lightmap texture, in the source computer the scene looks fine and the texture assigned to the lightmaps is the bakery one, but in other computers, the texture assigned is the dark one. upload_2019-3-6_15-12-2.png


    upload_2019-3-6_15-12-16.png
    Source computer.

    upload_2019-3-6_15-14-55.png
    Another computer.


    We are ignoring the folders in collab ignore as you described in the manual, so it's not a problem related to that.
    Baking the lights using unity lightmapper and synching the files in collab works fine.

    Thank you for any help or insight that you may have with this.

    best.
     
    guycalledfrank likes this.
  13. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    thanks dude, worked perfectly, good thing to know for the future if this happens with any package, cheers
     
    guycalledfrank and Loards like this.
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    I'm not able to reproduce it on any Unity version. Can you check if it also happens with included example scenes (e.g. example_sponza_day)? Perhaps you have some third-party scripts that get called during scene load/unload and mess up the process somehow?

    AFAIK people were using Bakery with collab with no problem. Is there anyone else in the thread using Bakery + collab to confirm?
    Are lightmaps files (*.hdr) synced? Lighting data assets are not necessary for Bakery, the renderer-lightmap link is stored in scene files instead. The asset is only used for light probes.

    That is correct.

    That is not how it should work though... especially the "manual assign is not working" part. Usually Unity does remember when you assign it manually, so please re-check if you have any scripted assets that could potentially override the asset.
    Also check if probes work in a fresh project with nothing but Bakery installed.

    That sounds like other computers are not executing Bakery scripts. Check if there are any compilation errors in console. One script failing to compile may prevent all other scripts in the project from executing.
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Alright! v1.55 was submitted and should be on the store soon. Changelog:


    - RTX support - massive performance boost on supported GPUs
    - Alternative light probe rendering mode
    - Added assembly definitions to improve script compilation times
    - Added improved light probe sampling mode to Bakery shader
    - Unity lights are now automatically marked as baked/realtime on >= 2017.3
    - Improved UI for light components
    - Fixed scene files becoming large
    - Fixed bright edges sometimes appearing around UV charts in Indirect/Shadowmask modes
    - Fixed opening baked scenes with minimum 5 required scripts on machines with no Bakery installed
    - Fixed Bakery shader failing to compile in some Android projects
    - Fixed double-sided option not working in Bakery shader with deferred rendering
    - Fixed denoiser attempting to process per-vertex shadowmasks


    upload_2019-3-7_18-0-39.png
     
  16. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Awesome work @guycalledfrank - thanks for the continuing support!
     
    guycalledfrank likes this.
  17. FGessler

    FGessler

    Joined:
    May 30, 2017
    Posts:
    4
    Today I have tried to bake a very large scene with just a skylight and a directional light. But even before the main bake process starts, I receive the fowling error message:

    GenerateGBufferMap error - Can't create texture

    Any idea what this means?
     
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Sounds like your scene takes too much VRAM in editor, so Bakery can't even finish scene exporting.
    Possible solution: try reducing Max Resolution (but not too much).
     
  19. SimDanny

    SimDanny

    Joined:
    May 19, 2017
    Posts:
    4
    Hi, I have an issue with my project. I recently upgraded my Video Card and this show up. I'm clueless as to what to do..

    upload_2019-3-7_20-20-1.png
    After clicking ok:
    upload_2019-3-7_20-21-35.png
    After clicking ok:
    upload_2019-3-7_20-22-26.png
    My gpu:
    upload_2019-3-7_20-31-55.png

    Ihave attached the ftracelog too.
    You have any idea why I can't back, is there anything I can do ?
     

    Attached Files:

  20. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    On the Assetstore page and probably in the documentation as well

    "NOTE: Requires modern Nvidia GPU (6xx or newer) and 64-bit Windows (7 or higher).
    Doesn't support AMD cards for baking."
     
  21. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    @guycalledfrank It's nice to see Unity themselves using Bakery in their own AEC Viz sample project.
     
    guycalledfrank likes this.
  22. SimDanny

    SimDanny

    Joined:
    May 19, 2017
    Posts:
    4
    So all I can do is change the video card ? Are there any plans to offer support for AMD ones in the future ? Thanks for the reply.
     
  23. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Not really at the moment. Bakery uses OptiX/CUDA/nvidia denoiser. In theory these can be replaced with RadeonRays and Intel Open Image Denoise, but that's a massive effort, and it would be hard to support/maintain/make sure the results between implementations match.
     
    Lars-Steenhoff likes this.
  24. xrami247

    xrami247

    Joined:
    Mar 7, 2019
    Posts:
    2
    @ guycalledfrank

    Is it possible to be on Shadowmask but also bake AO? I would like the benefits of Distance Shadowmask but would also love the results from AO in Indirect mode.
     
  25. SimDanny

    SimDanny

    Joined:
    May 19, 2017
    Posts:
    4
    That's sad to hear.. I'll see what I can do on my end.. maybe I can exchange the graphics card, the only reason I bought it was Bakery tbh :D.
    oh well.. Life is weird
     
    Last edited: Mar 7, 2019
    guycalledfrank likes this.
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Yeah they should work together already. Shadowmask mode is basically Indirect plus masks.

    I'm sorry if it wasn't clear Bakery only supports nvidia GPUs. I hoped it was kinda visible in the description:

    upload_2019-3-7_22-24-7.png
     
  27. xrami247

    xrami247

    Joined:
    Mar 7, 2019
    Posts:
    2
    @guycalledfrank

    Tried to get a good picture showing my results rn. Trying to figure out what I'm doing wrong in Shadowmask, trying to get the same AO
     

    Attached Files:

    • b1.PNG
      b1.PNG
      File size:
      324.1 KB
      Views:
      790
    • b2.PNG
      b2.PNG
      File size:
      278.5 KB
      Views:
      790
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Ah. So when you bake in non-shadowmask mode, everything gets multiplied by AO in the end (color = (direct + indirect)*AO). This is not correct at all, but then the whole AO effect doesn't really bear any physical meaning and I'm not a fan of using it. In Shadowmask mode everything happens basically the same way, but then you add a realtime light on top. Realtime light knows nothing about baked AO (because it's part of the lightmap at this point), so you get color = realtime_direct + indirect*AO instead. It's kinda possible to fix by baking AO into the shadowmask, but I'd rather think about the reason you're using AO, as it shouldn't really be necessary.
     
  29. SimDanny

    SimDanny

    Joined:
    May 19, 2017
    Posts:
    4
    Totally my fault bro :D, I based my search for a graphics card from some forum and didn't explicitly told them what for, I just said I wanted to bake faster.
    And didn't payed close attention.
     
    guycalledfrank likes this.
  30. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112

    Thanks for the reply;

    We ended migrating the whole project into a new one and that fixed the problems, probably there was a corrupt file over there that was causing troubles (but there was not a single error message in the inspector, weird)

    Now, into a more technical / use question, our project is using LDRP, in this pipeline the only lighting mode usable is sustractive, in bakery this would be the indirect render mode right? im asking this because doing the lighting in this mode with bakery i end up with all the objects casting realtime shadows, and not like using the unity lightmapper which only the dynamic objects use cast realtime shadow.

    upload_2019-3-7_17-18-17.png
    Cube on the right is the only one casting RT shadows (unity lightmapper using subtractive)

    upload_2019-3-7_17-23-37.png
    Bakery lightmapping using indirect mode, all the objects are casting realtime shadows along with the baked ones.

    In both cases the direct light is set to mixed.

    If this is how is suppose to work, are you planning to incorporate baking functions specific for for LDRP and HDRP?

    thanks!
     
  31. TiagoTFG

    TiagoTFG

    Joined:
    Jul 3, 2018
    Posts:
    7
    How long does it usually take for approval? Is there anywhere we can get it directly? I've read some mentions to a github of sorts.
     
  32. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Last night i dreamed bakery is available as ScriptableBakePipeline in the PackageManager. )

    edit: with same support
     
  33. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    Unless there's something I'm not understanding, I don't think I have 1,462 lightmaps. I've done some more testing and no matter what, the LM### is always a really high number. In my logs, it tells me X/## for preparing lightmaps, and it doesn't say X/1462. I've adjusted settings and have been able to get a successful bake, though it looks pretty terrible (in this scene; I've baked in other scenes and it looks great) so I'm still adjusting things and figuring stuff out.
    I'm doing a bake right now and in my log I got an ftrace for uvpos_world_LM1497 but when it's preparing lightmaps it's for LMA3, LMA14, etc. and it says 1/24, 2/24, etc. which seems to indicate there are 24 lightmaps, not 1,497.

    So either I'm missing something, or it's incorrectly labeling LM1497. Obviously you would know better as the developer.

    Awesome to see RTX support. Here's hoping my poor little 2060 can make the cut. lol
     
  34. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Mhmmm. A Benchmark page would be cool were we could post our results.
    e.g. for Sponza Day and Night for the beginning.
    Anyone an idea for the most easy method?
     
  35. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Wut dis mean?
     
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Released!

    Full Lighting should be what you need. Subtractive means everything is completely baked, but then dynamic shadows are subtracted.
    The tricky bit is to force Unity only draw dynamic shadow casters into realtime shadows. I'm not sure exactly how the engine manages this.

    There is a github for quick C# updates, but the core binary part is not hosted anywhere yet. That'll probably change.

    Hmm yes, that can happen in some circumstances.

    My rule of thumb is to set base Texels value to a low one, so it works on distant objects, and then increase Scale in Lightmap on the stuff close to the player. Also if you have lots of separate mesh renderer trees/bushes, you may want to use light probes for them instead.

    It definitely should get faster with that!

    A page where? I guess you can post the results here, and I can later organize them into a table.

    From the docs:
    upload_2019-3-8_13-13-43.png

    This is pretty cool, by the way. Any idea where to find/download it?
     
    Last edited: Mar 8, 2019
    Ar7ific1al likes this.
  37. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    It only showed on their webinar last night, they said it's TBD. But it is coming and all assets will be free to use in commercial projects as well. It's their London office model. They didn't highlight Bakery as being used but the scripts were on the lights when they were showing it, at the very least testing it.
     
    guycalledfrank likes this.
  38. rolando75

    rolando75

    Joined:
    Oct 30, 2017
    Posts:
    3
    How long did it take to bake the ArchViz Pro scenes?
     
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Here are some answers from the author himself (ignore the artifacts - they were fixed a long time ago):
    https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-55-released.536008/page-5#post-3592691
    https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-55-released.536008/page-8#post-3601046

    Last scene takes less time on my machine somehow (around 25 minutes - I have GTX 1060), not sure why exactly, possibly due to a faster SSD used for temp data, or maybe he was using more than 32 samples for skylight.

    RTX cards should do faster than that.
     
  40. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    ArchVizPro 6 HDRP Decals scene.

    FullLighting

    Directional None
    80 Texels per unit
    5 Bounces
    64 samples

    outputs 17x 4K
    in
    3h 12min
    on
    2x GTX 1080

    same with

    20 Texels per Unit (my android settings)
    16min

    looks fantastic with 80 Texels
    only the rain on the roof windows is running uphill.
    Why Bakery is not rotating the UV's. Come on.)

    Would be cool to try more bounces (5 is max) to light areas under table, chairs and leaves on the wall. Are little dark.
     
    Last edited: Mar 8, 2019
    guycalledfrank likes this.
  41. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hey there @guycalledfrank I've just been trying v1.55 and I'm running into some problems with a multi-scene bake.

    It's aborting with 999+ error messages of the following:

    Code (csharp):
    1. Main05 Main08
    2. UnityEngine.Debug:LogError(Object)
    3. <ExportScene>c__Iterator0:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:2907)
    4. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3337)
    5. ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2993)
    6. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    7.  
    This is with Unity v2018.2.21f1.

    The very last error in the log is:

    Code (CSharp):
    1. ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[UnityEngine.Bounds].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    4. ftBuildGraphics+<ExportScene>c__Iterator0.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:3487)
    These are the Bakery settings:
    Bakery-Settings.jpg

    Also, is the RTX mode checkbox meant to switch with Terrain optimization (i.e. Terrain optimization can't be done with RTX mode)?

    Thanks.
     
  42. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    A better idea is to increase skylight intensity I think. Each consecutive bounce is darker than previous, so it probably won't change the image much.
    Also you can use any number of bounces. Just type it in there, don't be confused by the slider ;) The slider is just to give an idea of a reasonable range.

    Ouch. This seems like a debug message I forgot to remove. It's not actually an error.

    THIS looks like an error though. I did change something related, but I can't currently understand why it happens. Can you try the attached file (replace it in Editor/x64/Bakery/scripts)? It will print out some error messages prefixed with "[DEBUG]" - try baking your scene and then copy the messages.

    Currently yes. Terrain optimization was useful in non-RTX mode, but RTX beats my heightfield raycasting code with its hardware-accelerated BVH/triangle intersection. It's also a bit complicated to combine the two.
     

    Attached Files:

    keeponshading and tntfoz like this.
  43. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    That's what I've done and it seems to get the job done. Any advice regarding size in lightmap for terrain? My terrain defaulted to something like 0.25 or so, and after baking the first time, the terrain was all very bright. I've increased it to 10 and it still bakes and it's no longer super bright.
    Also, my understanding is baked lights don't need the Unity light component. Is this correct? I want to make sure, because once I bake my scene, none of the baked lights are affecting the scene at all. If I turn on the Unity light component, it behaves like a realtime light even though it's marked as baked. I get the same results if I bake the scene with both Bakery and Unity light components on.
    My other scene (an interior, kind of like a sleek, brightly lit night club) doesn't have this issue, but there's also no terrain in that scene.

    I'll update to the newest version of Bakery later and try it out. Excited to see what kind of improvements to baking speed I can get with RTX support!
     
    guycalledfrank likes this.
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Interesting. It's a 2nd time I hear about this bug. It seems like no matter which settings you change, next bake will be always successful. It's probably not even linked to resolution, and it's unclear what steps exactly should be taken to reproduce this. If it repeats, try remembering what you possibly changed to cause this

    Completely baked (Full Lighting mode or "direct and indirect" option on the light) don't need Unity lights, yes.
     
    Ar7ific1al likes this.
  45. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Apologies for the delayed reply!

    Thanks for the new file - replaced the one in the project and baked again with the same settings as previously which generated the below log messages (cropped the first 60 "Added new autoatlas group" off):

    Bakery_Debug.jpg
     
    guycalledfrank likes this.
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    My bad - I realize what's going on now. Can you see if it works with these two files?
    ftBuildGraphics.cs -> Assets/Editor/x64/Bakery
    BakeryLightmapGroup.cs -> Assets/Bakery
     

    Attached Files:

    tntfoz likes this.
  47. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hi @guycalledfrank the new files seem to have fixed the problem and it's currently baking (may take a couple of hours) but it's definitely working now!

    Thanks for your help!
     
    guycalledfrank likes this.
  48. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Hey @guycalledfrank, what happens when you go to bake with multiple but different GPUs? I know in the past when I have used Unity's experimental GPU baking, it will default to my lesser card. With Bakery, are both cards used? Or can I select one somewhere to use the better one?
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Cool - I updated the github with this fix.

    From OptiX (on which Bakery is based) docs:

    ...
    mixed multi-GPU setups are available on all supported GPU architectures which are Kepler, Maxwell, Pascal, and Volta GPUs. By default all compatible GPU devices in a system will be selected
    ...
    In mixed GPU configurations, the kernel will be compiled for each streaming multiprocessor (SM) architecture, extending the initial startup time.
    ...
    For best performance, use multi-GPU configurations consisting of the same GPU type. Also prefer PCI-E slots in the system with the highest number of electrical PCI-E lanes (x16 Gen3 recommended).
    On system configurations without NVLINK support, the board with the smallest VRAM amount will be the limit for on-device resources
    ...
    In homogeneous multi-GPU systems with NVLINK bridges and the driver running in the Tesla Compute Cluster (TCC) mode, OptiX will automatically use peer-to-peer access across the NVLINK connections to use the combined VRAM of the individual boards together which allows bigger scene sizes
    ...

    Mixing GPUs with RT Cores and without RT Cores is not supported
     
    tntfoz likes this.
  50. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Thanks for the reply @guycalledfrank. I currently have a GTX 980 and an RTX 2080. Was curious what might happen when I choose the experimental RTX option. It baked and all, but than Unity editor hard-locked. Not sure if that event was related or not haha.
     
    guycalledfrank likes this.