Search Unity

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

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

  1. SmashedAvocado

    SmashedAvocado

    Joined:
    Dec 19, 2013
    Posts:
    45
    Sounds good, I'll abstract out the main parts and DM you sometime.

    Question on UV Processing:
    Do all assets have to have "Generate Lightmap UVs" on them for "Adjust UV padding" to work? I read through the docs and this seems to be the case. Just wondering because I think I need to go and tick it on all my meshes (or script it) as some objects get bright spots without Generate Lightmap UVs turned on. I'm not super familiar with how UVs are used here.
     
    guycalledfrank likes this.
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    If area light "self shadow" checkbox is enabled, it will cast shadows (block all lights).

    Pretty sure there were lots of mobile releases using Bakery over the years. I don't remember all of them by names though. Some of them are among my asset store screenshots: "Dead & Buried 2" is an Oculus Quest game (Android), "Infinity Ops" is a mobile game.

    Not sure what I'm looking at. Some objects are dark, some are bright, there is some realtime lighting/fogging going on.
    Are you sure these objects have lightmapping UVs? Did you try Checker Preview to check the texel sizes you are baking with? Did you test the same models during your test bake?

    I treat this checkbox as "I dont't want to UV, do that for me", but if it's disabled I respect user UVs and don't touch them.
    Each model is adjusted individually, you can have some with and some without.
     
  3. KamiKaii

    KamiKaii

    Joined:
    Dec 10, 2019
    Posts:
    2
    Purchased. keep up the solid support!
     
    guycalledfrank and atomicjoe like this.
  4. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Real-time fogging - yes I have that turned on, not an issue. All objects have Unity's auto generated UVs for lighting. Checker preview shows nice overlay over objects. I have tested in the same scene with the same objects. If I bake one or two buildings, results are nice, however, when I enable more buildings results are as in screenshot. I think I was getting an error, not in those words - "failed to generate UVs for scene-name ". However, since baking continues and finishes normally, I assumed that it is not a problem. Perhaps it is caused by too much geometry in the scene or because of one of the models. In successful one or two building baking cases, the amount of light was the same as in the baking with all the objects enabled. I'll try baking in very low settings and turn on model by model in each bake. I will see if the issue is caused by one of the models. However, I am getting exact same issue in few scenes, with different models in them, when all of them are enabled. P.s. the lowest scene triangle count is 134 million, while others exceed 300 million.
     
  5. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I think you should post a screenshot before the bakery render and another one after the bakery render, from the same angle.
    We don't know what your scene should look like otherwise.
     
  6. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    I tweaked some settings and on high quality settings now get a pretty good result on my quest. Great asset! However, theres one problem left: I rendered 2 scenes, they mostly share the same objects. Everything is fine when i rendered scene 1. After rendering scene 2 and reloading scene 1 one of the objects has very weird artifacts. It is always the same object and it only happens after i baked scene 2 and reloaded scene 1. It happens vice versa as well, so if i render scene 2 first, go to scene 1 and render it and go back to scene 2 after both renders are done the artifacts appear on the object in scene 2.
    The settings of the model are the same as in all other models I use in the scene. It also happens on one other object but not as bad as on this one. In the screenshots you can see the object in either scene and the settings of the object. Any idea why this happens?
     

    Attached Files:

  7. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Use the "UV padding increase only" option:
    https://geom.io/bakery/wiki/index.php?title=Manual#UV_padding:_increase_only
     
    guycalledfrank likes this.
  8. HanAusBerlin

    HanAusBerlin

    Joined:
    Sep 13, 2017
    Posts:
    76
    atomicjoe likes this.
  9. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
     
  10. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    So I did baking in other map, which also doesn't give any good result. It seems results are always random for some reason. In some cases I don't change anything and the baking looks different. I'll attach some screenshots, I get error "Can't repack LOD UVs for "mapname" ", however, sometimes I don't get this error and map is not baked correctly or vise versa. Sometimes I get good results with only few buildings enabled, and sometimes I don't
    The first image is without baking and lights on.
    0 not baked.jpg 1 Changing from one to zeropointfour.png 2 Changing from  zeropointfour to one.png 3 hiden one building.jpg 5 reversed hiden buildings.jpg

    (All lights are set to baked and they have bakery script attached, objects are static, models have auto generated light map UVs. Unity version 2019.2.6f1)
     
    Last edited: Apr 28, 2020
  11. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    The remaining screenshots.
    6 error back baked corretly.jpg 7 error back baked cone buildign incorect.jpg 8 everything blue.jpg
     
  12. AngryMuppet

    AngryMuppet

    Joined:
    Mar 28, 2014
    Posts:
    34
    Hi!

    So, just purchased this asset - impressed with its speed and stability and seem to be getting some good results in certain scenes. I've hit an issue though.

    I'm lighting for mobile so trying to keep my lightmaps small. I have some geometry like cupboards setup with probe anchor overrides pointing to the cabinet on the doors and then all cabinet mesh renderers set to contribute GI but receive GI from Light Probes.

    This gave decent results in Unity's CPU Progressive but I don't seem to be able to get a comparable look in Bakery - any ideas?

    upload_2020-4-28_17-57-37.png

    Left is Unity CPU Progressive, Right is Bakery

    Bakery Settings:

    upload_2020-4-28_17-58-7.png

    Mesh Properties:
    upload_2020-4-28_17-59-2.png

    I'm running Unity 2019.2.21f

    Any ideas?

    Thanks!
     

    Attached Files:

  13. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    When rendering light probes, Bakery doesn't disable objects that are set to contribute GI, so they'll get in the way of the light probe rendering and darken it (since they become black when rendering light probes).
    To fix this, manually disable all the objects that contribute GI but are lit with light probes and re-render the light probes only. Then the lightprobes will be rendered correctly.
    This fixes it when using the legacy light probe generation, I don't know if it works well with L1 lightprobes though, so if it doesn't fix it, try setting the light probe generation to Legacy.
    Legacy is slower to render than L1, but the latest Bakery update on GitHub speed it up A LOT.
     
    guycalledfrank and AngryMuppet like this.
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
  15. AngryMuppet

    AngryMuppet

    Joined:
    Mar 28, 2014
    Posts:
    34
    Thanks @atomicjoe I'll give it a go and see how I get on, be great if we could get a proper fix to support in the probe baking eventually!
     
    atomicjoe likes this.
  16. AngryMuppet

    AngryMuppet

    Joined:
    Mar 28, 2014
    Posts:
    34
    This didn't fix it unfortunately - no change at all to the look of it after Rendering, disabling the objects, rendering light probes only in legacy (or L1) any other ideas/suggestions?

    Thanks
     
  17. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Set the lightmap size to zero for the objects that contribute gi but are lit by lightprobes, rerender the lightmaps, disable this objects and then render the lightprobes.
    This is how I do it.
     
    guycalledfrank likes this.
  18. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    41
    Is it possible to make multiple prefabs that overlap each other without them affecting each other? My scene has an area where different options can be enabled/disabled but a lot of those options overlap. I want be able to bake all the options in one go to save myself a lot of time.
     
  19. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    You could put all the object options inside a LOD group. This way Bakery should render them all at once without them interfering with each other.
    https://docs.unity3d.com/Manual/class-LODGroup.html
     
    guycalledfrank likes this.
  20. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Hi, I haven't solved my baking issues, but I am experiencing other issue. We transfer map file via asset bundle to different project. I noticed that the lighting became different across these two projects. I assume it is cause by Bakery as I didn't changed anything else. It might be something else, but if it is Bakery you might know it. I removed Bakery and manually deleted separate files that includes "bakery" from Unity project and transferred the maps file again. This didn't solve the problem, maps still don't look the same in each project (not baked). I manually disabled all real time lights, post processing, skybox, lighting settings, everything seems to be the same in both projects, but map is still being lit differently. The first image shows where Bakery was installed but is deleted now, the second is where it never was.
    Before transfer.jpg After transfer.jpg
    P.S. don't mind shadow quality. Skybox should be the same color, contrast on models should also be the same, darkness of the shadows should be the same etc.
     
    Last edited: Apr 29, 2020
  21. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Check the Color Space on each project: Edit -> Project Settings -> Player -> Other Settings -> Color Space
    Read the manual:
    https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html
     
    LaurynasLubys likes this.
  22. alerbuffon22

    alerbuffon22

    Joined:
    Apr 7, 2020
    Posts:
    8
    Hi, thanks for the awesome asset, everything works fine. but I recently encountered the following problem, if I use lods then a warning appears. In my process, I bake 2 lightmaps for each level of lods with different resolutions, everything works well in my process, but the need to skip these warnings takes time, it is possible to somehow disable them in the code. And is it possible to display a checkbox with disabling warnings in the settings, thanks
     

    Attached Files:

    • Lods.png
      Lods.png
      File size:
      321.2 KB
      Views:
      381
    c_Feng likes this.
  23. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
  24. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Disable warnings in Bakery:
    https://geom.io/bakery/wiki/index.php?title=Manual#Warnings
     
  25. jppolotto1971

    jppolotto1971

    Joined:
    Apr 16, 2019
    Posts:
    1
    Hi. I just bought your asset yesterday.

    I'm having trouble with prefabs. Maybe I didn't understand what the exact worflow shoud be. I read the manual however I haven't succeeded.

    If I set the "Bakery Lightmapped Prefab" script to the root component of the prefab (in the prefab editor) I get... "Error: this game is not a prefab". Now, if I do the same in the scene editor, I get "prefab contains unapplied data...".

    Could you please explain the right workflow?

    Thank you

    Version: 2020.1.0b5.3485 Personal
    Revision: 2020.1/staging f017efceb459
    Built: Thu, 02 Apr 2020 17:34:00 GMT
     
    Last edited: Apr 29, 2020
  26. Konyak

    Konyak

    Joined:
    Nov 21, 2019
    Posts:
    20
    Hi, I'm new in Unity and Bakery too.
    I need help, I've tried several settings already, but it's always the same result: Faulty Lightmap and doesn't keep Light Probe data. I'm using the latest Bakery, and 2019.3.0f6 Unity.
    (Pc: i7-7500, 1080ti, 16 GB, SSD)

    I would be very grateful if someone could help.

    Sorry for the bad English!

    Untitled-3.jpg Untitled-4.jpg Untitled-5.jpg Untitled-6.jpg
    Untitled-3.jpg Untitled-4.jpg Untitled-5.jpg Untitled-6.jpg Untitled-7.jpg
     
  27. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Since this morning, I've been unable to render any lightmaps. I keep getting an "Error exporting scene", I have tried restarting Unity, my PC, and rebuilding the Library folder.

    This only seems to happen on this scene as any other scene seems to bake just fine.

    2019.3.11 - SRP - Bakery 1.71

    upload_2020-4-29_12-23-56.png

    I think I fixed it, it looks like the first failure left some objects hanging around in the scene (terrain export). Finding and deleting them and re-rendering seems to be working as expected.
     
    Last edited: Apr 29, 2020
  28. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    41
    Thanks for the advice, I did give it a go and no luck :/ I have multiple meshes per prefab and bakery is giving me an error saying it is not supported.
     
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    OK, sounds like a bug with GI VRAM optimization. This one will be probably removed due to it being too complicated/error-prone/super hard to reproduce. Set GI VRAM optimization to Force Off: https://geom.io/bakery/wiki/index.php?title=Manual#GI_VRAM_optimization Then reduce Texels Per Unit/Scale In Lightmap to not go out of memory.

    Bakery doesn't use the "receive GI" parameter (as it's not supported on all Unity versions Bakery runs on). If you want an object to cast shadows/affect GI but NOT have its own lightmap and use probe lighting, just enable contribute GI (renamed "Lightmap static") and set Scale In Lightmap to 0.
    Added to manual: https://geom.io/bakery/wiki/index.p....2FGI_without_having_a_lightmap_on_its_own.3F

    I'm surprised it works, sooner or later it'll break. I need to implemented proper multi-LOD support for manually created groups.

    You need to apply prefab changes:

    upload_2020-4-30_11-36-48.png


    Lightmap weirdness looks like broken mesh UVs. Did you generate lightmap UVs for assets in Unity?

    Probes: I think you mean reflection probes, not light probes (I can only see them lacking)? Try "update skybox probe" button (and "render reflection probes" if you have them).

    OK yeah I assume something went wrong once, then an "__ExportTerrain" object appeared and it was breaking until you deleted it? I'm not sure why you got it the first time (would be awesome if you can recall any steps to reproduce it), but it looks like after the script fail some temporary objects were not cleared, and I know it indeed won't work if the __ExportTerrain is present in the scene.
     
    AngryMuppet and Acissathar like this.
  30. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Currently it's either LODs or Groups. Note that you can still use Lightmapped Prefabs without Lightmap Groups.
    Alternatively you can just... bake your prefabs separately? Then instantiate them so they overlap?
     
  31. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    Correct, it was the ExportTerain objects sticking around that I finally removed.

    Unfortunately/Fortunately it hasn’t had an error since. As far as I know, I wasn’t doing anything special. Bake failed because gpu ran out of memory, I tweaked the texel + samples settings and then it errored leaving the terrain objects.

    If it happens again (leaving the objects) I’ll try to get better notes to see if that helps out
     
    guycalledfrank likes this.
  32. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    Hi,

    Is there a log anywhere that tracks what object Bakery is trying to handle when an error is generated?

    I get "Can't map texture" followed by "Can't save smooth UV pos" followed by "Can't render UV GBuffer", and then the Bakery error: "ftRenderUVGBuffer error: 10".

    These are during the "Rendering lightmaps - preparing" stage.

    And then Unity crashes!

    Thanks for your help.
     
  33. Da-Luk

    Da-Luk

    Joined:
    Apr 25, 2017
    Posts:
    53
    Hi,

    today i purchased the RTPreview tool but it takes longer for a single frame in a small preview window as a full bakery render, what i'm doing wrong?
    I'm using bakery 1.71 on Unity 2019.1.1f1 using linear color space with a Geforce 1080ti (newest drivers) no compiling errors

    Thanks in advance
     
  34. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Hey, I'm really happy with the results of Bakery but as my scene got larger I've started encountering issues. My scene has a lot of objects and when I start a bake it sometimes takes 1 to 2 hours to "adjust uv padding", while sometimes it goes pretty quick. I've got Xatlas enabled so I understand it has to process the uv's but why does it happen every time I start a bake? Especially when I change the texel density. Is it necessary or is there a way to not go though it every time I change the texel density?

    Edit: I just found out about an "Adjust UV padding" checkbox but does that mean I have to run a bake with it checked and leave it unchecked for the next bakes? What if I add a new object, do I have to adjust everything again?
     
    Last edited: May 3, 2020
  35. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Enable "adjust uv padding" just the first time you bake a scene and then set it to "don't change" the rest of the times.
    UV padding should be readjusted when you change the texel density to get the best fitting, but if you just enable it the first time with a low texel size and then set it to "don't change" with higher resolution texels, it will still be fine.
    EDIT: Or is it the other way around? I don't remember. Just test it.
    You will just lose very little resolution in your lightmap textures.
     
    Last edited: May 3, 2020
    guycalledfrank and Goldenvale like this.
  36. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Thanks for the answer! I was just editing my post because I found out about this. But what happens when I add a new object?
     
  37. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It will not get it's UVs modified.
    You can just disable the UV adjust until your scene is finished and then enable it, bake it and disable it again.
    UV adjust is not needed. It's just better.
     
    guycalledfrank and Goldenvale like this.
  38. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Thanks a lot! I think that answers my question.
     
  39. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Thanks! That was the problem, for the last two weeks of everyday baking, this option was causing issues. As you've seen the baking results were very dark or just coloured in random colours. In instances I wouldn't get an error, but results would be bad or randomly good.[/QUOTE]
     
    guycalledfrank likes this.
  40. Apollo75

    Apollo75

    Joined:
    Jun 29, 2018
    Posts:
    17
    Hello,

    I have an issue with lightmapping. I am working on Big scene for open world car games. So, I baked my scene with bakery. i exported this scene with bakery asset using windows PC. but when i import this scene in my mac, the scene shows some artefacts. and i cannot rebake scene in Mac. its hows this error. how can i solve this artefacts problem and run bakery in mac?
     

    Attached Files:

    • unnamed.jpg
      unnamed.jpg
      File size:
      112 KB
      Views:
      401
    • 11.jpg
      11.jpg
      File size:
      900 KB
      Views:
      401
    • 1.jpg
      1.jpg
      File size:
      753.9 KB
      Views:
      402
    • 8.jpg
      8.jpg
      File size:
      862.9 KB
      Views:
      400
  41. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Bakery is not compatible with Mac. It's only for windows.
    That being said, I understand you would want to bake on Windows and move the project to a Mac to compile for iOS.
    I think you can make a scene baked with Bakery on Windows work on a Mac by removing the "Assets\Editor\x64\Bakery" folder from your project.
    I haven't tried it and it could not work because of dependencies, but it's worth a try.

    @guycalledfrank maybe it should be a section on the manual about distributing a scene baked with Bakery without having Bakery installed in the project?
     
    Last edited: May 4, 2020
    xVergilx likes this.
  42. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    guycalledfrank and atomicjoe like this.
  43. Apollo75

    Apollo75

    Joined:
    Jun 29, 2018
    Posts:
    17
    It does not work.
     
  44. Apollo75

    Apollo75

    Joined:
    Jun 29, 2018
    Posts:
    17
    lightmap works in mac too....but show some artefacts....
     
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Apollo75 likes this.
  46. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It must be Bakery's UV adjust option.
    Try baking on Windows using the "Remove UV adjustments" and open it on the Mac to see if it fixes the artifacts.
     
    Apollo75 likes this.
  47. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hey! long time without posting;
    EDIT 2: FIXED

    Deleting everything related to Bakery from the project and re installing fixed.

    Holy S... what sorcery is this.


    I just got RTPreview and i cant get it working, everytiome i press "preview" i get this error.
    upload_2020-5-5_15-33-58.png


    Also the scene view gets all dark and i cant get it working again, i can bake lightmaps normally and see them in Game view, but scene view every asset looks black

    Unity 2019.3.0f6
    Latest Nvidia drivers.

    EDIT: Noticed that i cant update or clean install Bakery, everytime i try to update this happens if a click cancel, Bakery is partially installed, only the shader folder.
    upload_2020-5-5_16-16-49.png


    Any help? Best.
     
    Last edited: May 5, 2020
    atomicjoe likes this.
  48. Jakub-Pilar

    Jakub-Pilar

    Joined:
    May 18, 2015
    Posts:
    48
    Hi,

    I had "can't create texture" error and baking stopped in 55% everytime, tried everything and then I tried to unwrap UVs (in Blender, just auto-unwrap UVs function) on the main and biggest mesh in the scene and voilá! It works now!!

    So maybe this helps somebody..

    Jakub
     
    guycalledfrank likes this.
  49. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    I've just purchased this and started reading the documents and started baking my first lightmap and it does not seem to proceed any further.
    - Progress bar shows no progress even after 6 hours (does it take this long, it did not crash the progession bar window responded to mouse clicks) see image1
    - Lights in the scene, I have 1 directions light with Aura2 + Bakery directional light script, 4 spotlights with Aura2 + Bakery point light script, 1 Aura Box volume in the Scene. I also have Postprocessing enabled.
    - Project settings - legacy render pipeline in Unity 2019.3.7
    - I used Indirect rending option as render lightmap option, please see image 2.
     

    Attached Files:

  50. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Remove the UV adjustments and try again.