Search Unity

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

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

  1. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    61
    hi, I just got Bakery and am using it with 970 gtx, do you think getting something like a 1080 will help significantly reduce the bake times? and what about the rtx cards.
     
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I started developing on 970 (3.5gb) myself and then switched to 1060 (6gb). 970 is a good card, but its biggest weakness is its memory. I would expect something like 15-25% boost in performance, but the biggest advantage is that you'll be able to bake bigger scenes.
    Currently Bakery doesn't take advantage of RTX (as it's based on nvidia's own OptiX library which doesn't fully support it yet), although the denoising part might. That will likely improve in the future. For now just look at regular shading benchmarks between cards.
     
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Wishlist:
    Titan RTX
    24 GB GDDR6

    No more running out of memory so fast :)
     
    guycalledfrank likes this.
  4. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    To simplify my question. You know no issues of your asset and aquas working together?
     
  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    This one?
    I haven't heard of it before. Looks pretty good. I guess you're the first to report an issue. Before/after screenshots would help.
     
  6. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138


    How it looks with Unity Lighting:



    I've been working with it for a while now and nothing seems to get the same look I had with unity. It's as if the lighting is vastly different. I'm simply trying to shorten those calc times with unity lighting and I'm happy with it's result, however it's a good 5 hour run. I feel as if enlighten is the reason it turns out great. I've turned it off but that is what is taken 5 hours to run! What do you suggest?
     
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    - Ambient lighting looks really black. Do you use any Skylights?
    - Water seems to reflect something very black as well. If you can completely disable distortion/normalmap, we'll be able to see the reflection clearly. Do you reflect 100% the same objects you draw above the water? Or are reflected objects different (maybe you use different LODs for the reflection)?
     
  8. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    I've turned a couple things off and made some improvements that could be causing the relection to happen, it just seems odd that with the unity lighting it takes little effect on it.

    I'm actually not able to render the scene any longer and getting this error.
    Can't Map Texture. UVGBufferGen Error. Have to force restart on unity as it locks up.

     
  9. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    I've accidentally removed my old light map. Lost a good nights worth of baking....Unity forced restart always goes to last known scene where you closed the program, I ended up modifying my good scene... Really sucks!

    This is not an asset I can continue to mess around with. I think it's great but I'm just going to move on without it. Too many issues for my project to keep it. If can issue a refund that is great otherwise best of luck. Here is my order : IN010000655804
    A couple of issues I see are merged objects via scripts I've made to optimize performance are not looking good at all with Bakery.

    Error message ient away after clearing my baked data from unity baked lighting map.
     
    Last edited: Jan 2, 2019
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    This error rarely happens and usually means that either you're catastrophically out of memory (other GPU-intensive software in the background could contribute to that) or something crashed the driver before you hit the render button.

    There is a chance to recover it. Try going to experimental settings and removing ALL checkboxes in the Lightmapping tasks section, then hitting the render button again. Lightmap textures are still stored on your hard drive, even if you cleared baked data. If your scene wasn't modified much, it will reassign them exactly as they were without spending time on export/bake again.

    They likely won't look good with Enlighten either. If you naively combined multiple meshes together, their UVs will overlap. You need to call GenerateSecondaryUVSet on them after combining. If you already do, another problem you may encounter is the mismatch between the size of lightmap texels and UV charts/padding. In this case using a larger padding argument in the GenerateSecondaryUVSet function OR increasing resolution for these objects (mesh renderer -> scale in lightmap) will help.

    I can do that of course. Sorry it didn't work for your project. I'd suggest giving it another try when you're less emotional though.
     
    jeromeWork and Mark_01 like this.
  11. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    It's all good It's really not a huge deal. I've already started another bake. :)

    It does look great with enlighten. I've been working on lighting for months and optimizing my meshs so they look good with it. Realistically my project is too far along to work this in if I require revisiting those meshes again.
     
    guycalledfrank likes this.
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    If it worked before, then they probably only require resolution tweaking, either global (texels per unit) or per-object (scale in lightmap).
     
  13. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Hi there Frank!
    I'm having a little issue with Bakery: it imports the lightmap textures 2 times once the render is done, forcing Unity to recompress the textures 2 times.
    This doesn't seem like a big deal, but when building for mobile, compressing textures to ASTC format can take a long LONG time even on a high-end PC.
    Again, when you don't have to deal with lots of lightmap textures this is not very noticeable, but when you have 25 4096x4096 textures to compress in ASTC high quality, I can tell you it's VERY noticeable to import and compress them twice.
    My sanity is at stake here!

    Also, happy new year 2019!
     
    wd521wd and guycalledfrank like this.
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Weird, that shouldn't happen. Does it happen with all textures, or just some? Can you reproduce it on a simple scene?
     
  15. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It happens with all textures. I'll try to make a repro.
     
  16. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Also, is there any specific reason why Bakery is generating HDR files instead of EXR files like Unity does?
    Are they really EXR format inside or are they really HDR format?
     
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    EXR and HDR are not that different, not sure what your question is.
     
  18. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
     
  19. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Unity supports both, so I just used the one I found easier to generate. Bakery uses DirectXTex to output final lightmap files for Unity, and it has a good support for HDR.
     
    atomicjoe likes this.
  20. Cre8ing

    Cre8ing

    Joined:
    Jun 2, 2018
    Posts:
    5
    Sorry for my late reply...

    I do not know the correct error message but it was only about 40 area lights. So maybe it was something else.

    I do not know how much memory there was left during the light baking but closing Unity there was still about 360 GB of free space.

    After removing the temp files and moving the light map files to a different location, it succeeds to render without errors. I have to do this every time I want to render again.
    This is a minor inconvenience when you compare the time and quality of rendering with enlighten or progressive.


    Another small question: if I make a group render the light maps on the other assets disappear. They are still in the folder but are no longer assigned. I thought I would use this to not have to render everything again every time. I have not been working with Unity for very long, maybe my working method or my expectations is not correct?
     
  21. Kolgrima

    Kolgrima

    Joined:
    Feb 2, 2009
    Posts:
    40
    I have a strange issue! I can bake my scene and it all looks ok like this:

    2019-01-03 11_25_56-Window.png

    But when it gets additively loaded in our game it looks like this:

    2019-01-03 11_24_14-Window.png

    As I mentioned above, the only difference between the two images is that in the second one we are additive loading the scene into our main scene (which works fine with default unity baking). I'm probably missing something simple here but I can't seem to solve this.
     
  22. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    hello Mr.F could you be so kind to help me solve this , any guidance what to check for next
    not certain what I changed , could be related to just added a new shader Beast v2018.1 ?



    Error: Failed to save HDR file. See console for details. (5)
    UnityEngine.Debug:Log(Object)
    <RenderLightmapFunc>c__Iterator2:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3821)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2549)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    follow up on the above Error (Failed to save HDR File). I found that security updated and started running in realtime scanning on some catch servers,.. using Bakery even with the some down time to deal with any conflicts still saves countless days of baking... keep up the good work
     
    Last edited: Jan 4, 2019
  23. Omzy

    Omzy

    Joined:
    Jun 28, 2013
    Posts:
    31
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Weird. Is it with "Render" or "Render selected"? I can't think of any reason it can happen with normal Render... So far I can only ask you to send me a scene where it can be reproduced, then proper debugging can be done.

    That... may happen currently, if you use Shadowmask, I think. The selective render is a bit unfinished.

    Oh yeah I think I fixed that recently. Just sent you a patch :)

    Usually it means insufficient disk space.

    Yup, just sent you the same patch.
     
    Mark_01 likes this.
  25. jorisvr

    jorisvr

    Joined:
    Jan 3, 2018
    Posts:
    3
    I get this error when trying to create a baked prefab.
    error: prefab contain unapplied data (gameobject (UnityEngine.GameObjct).m_Name)

    can anyone help or shed some more light on this (pun intended)

    cheers!
     
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Are you on 2018.3? There were some changes to prefabs in this version, and Bakery doesn't support that yet. You can just add "return true;" to the beginning of IsValid() function in BakeryLightmappedPrefab.cs. Then Bakery won't check if there are actually any unapplied changes and will always apply.
     
    Last edited: Jan 4, 2019
  27. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    You mean 2018.3 right?
    About the new prefab thing.
     
  28. jorisvr

    jorisvr

    Joined:
    Jan 3, 2018
    Posts:
    3
    sorry dude, my programming skills are limited. Can you please give me an exact example?
     
  29. Cre8ing

    Cre8ing

    Joined:
    Jun 2, 2018
    Posts:
    5
    it was with "render". I send you a message with a link where you can download the basic project.
    See when you have time, since I can work around it is not so urgent anymore. It might be good to know what I'm doing wrong (maybe a lot ;-)).

    in the selective rendering I have indeed used SH and shadowmask for the best quality. Since I do not use Unity for games, loading speed is of less importance to me.
     
    guycalledfrank likes this.
  30. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Open the "BakeryLightmappedPrefab.cs" file inside the "Bakery" folder, in the project window.
    On line 16, just write:
    return true;


    Save the file and go back to unity.
     
    guycalledfrank likes this.
  31. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Ouch, typo. Yes, 2018.3 :)
     
  32. jorisvr

    jorisvr

    Joined:
    Jan 3, 2018
    Posts:
    3
    Thanx a lot! It works!
     
    guycalledfrank likes this.
  33. BeetBeet

    BeetBeet

    Joined:
    Mar 15, 2017
    Posts:
    1
    hello,

    I have strange error when i try to render light probes in my project,

    i have window with: "ftrace error: Unknown error (-10733741676)

    In scene i have one Light Probe Group.

    Anybody can help with that?
     
  34. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Did you bake lightmaps before the probes in the same scene? If not, can you check if it works in this order?
     
  35. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    61
    @guycalledfrank I tried it out a bit and I think it's an awesome piece of tech. will post more results here when I work on it further next week.
    One little (big) request I wanted to ask was if we can get distributed baking inside of bakery, I would even pay for it, if it ends up being a standalone product.
    Being able to use multiple PCs for bake would be a game changer for unity devs.
     
    guycalledfrank and atomicjoe like this.
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    If you mean distributing the work across multiple machines, this is rather tricky and not planned yet. You can however use multiple GPUs on a single machine.
     
  37. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Another issue with lightprobes:
    When rendering lightprobes, Bakery doesn't disable Realtime and Mixed Lights in the scene and they end up baked in the lightprobes.

    This is not correct: only lights set to "baked" should be fully rendered to the lightprobes.
    Mixed Lights should only contribute their indirect light to the lightprobes and lightmap.
    And Realtime Lights should be ignored from both lightprobes and lightmaps.

    Check this section of the manual about this specific topic:
    https://docs.unity3d.com/Manual/LightMode-Mixed.html

    EDIT:
    Mixed Lights should only contribute their indirect light to the lightprobes and lightmap
    WHEN THE LIGHTING MODE IS SET TO BAKED INDIRECT otherwise they should be fully baked both in the lightmaps and lightprobes.

    This is a confusing topic... :p
     
    Last edited: Jan 6, 2019
    guycalledfrank likes this.
  38. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    61
    Yup, but please do consider it, as it is a huge gap in unity's arsenal which unity(staff) is not willing to fill anytime soon.
     
  39. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    Is blendable transitioning lightmaps something on the 2019 forecast? The game I am the artist for now uses Bakery entirely for performant lighting and I am interested in being able to create a horror game environment where a building's power goes out randomly, using lightmaps rather than dynamic. Or other use cases like day/night cycles. How far down in terms of development is that capability?
     
    Mark_01, Lars-Steenhoff and atomicjoe like this.
  40. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I'm interested in this too.
    It would be REALLY handy.
     
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Ah yeah, I see. It doesn't really bake these lights - but it can bake lighting from visible scene geometry, even if it's lit via realtime stuff. There are possibly more odd cases like that. I'm still going to implement a new separated probe system soon. And this one is quick to fix.

    ...story time. In the very beginning Bakery wasn't meant to be a swiss knife for every project - it was a tool to get lighting done for the game I'm still working on. In a sense it's the reason behind the quality/perf/features - making the tool for an actual game with specific (ambitious) requirements is different to creating a theoretically fits-everyone generic product. Being a user of your own product makes you care about it. More importantly, you actually test it with all your whacky real-life content you would often not consider from a tool programmer's perspective. Ironically I don't even believe in fits-everyone game engines, but here Unity does a good job to disprove me - although it took many years for it to get where it is, and the best part is still its extensibility, not out-of-the-box feature set.

    I wasn't expecting so many people to use the lightmapper - and I'm incredibly happy you guys do! But now apart from my original roadmap I have to detour into many-many other things that don't benefit my game as much, but make a big difference for other users.

    So there are good news and bad news. Bad news: I'm slowed down due to the amount of tasks. Good news: can't postpone the game any longer - HAVE to release a decent demo THIS year. And the game WILL have the kick-ass probe system, as well as blendable lightmaps, because I need to get these opening doors and switchable lights working.
    Now it's all up to me trying to balance everyone's expectations from the tool, the game and regenerating energy spent on this stuff efficiently.
     
    Last edited: Jan 7, 2019
    Cascho01, Mark_01 and greengremline like this.
  42. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Would it be possible to save the settings that were used to bake a prefab into that prefab with the ability to grab them if we needed to rebake the prefab? Right now, we might bake 30 prefabs in the same scene, each with different settings, and it can be annoying to have to figure out which settings were used for that prefab when it comes time to rebake it

    Also, in response to your last message, would that probe system allow us to do realtime gi in prefabs?
     
  43. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Sounds like you actually want to bake them in different scenes? Like, instead of having a single scene with with all the prefabs, you can separate them into groups with different settings and bake there?
     
  44. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Honestly, I'd prefer not to have to bake them in a scene at all especially with unity's new prefab workflow, but I'd be cool with at least making the prefabs scene-independent in regards to the settings

    If I were gonna do it myself, I'd have a boolean "saveSettings" on BakeryLightmappedPrefab, and if enabled, it would have a serialized class stored on the prefab copying the settings from the bakery lightmap inspector window at the time the prefab is baked. I could see that causing a problem if you tried to bake multiple prefabs with different settings in the same scene, so maybe the user could be in charge of re-applying the settings with a button on the prefab - "Re-apply prefab lightmap settings"
     
  45. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    This... is actually pretty easy to do. The class used for settings storage is the same one used in baked prefabs, so all you need to do is to directly copy variables from object A to object B. I can hack something tomorrow.
     
    greengremline likes this.
  46. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    getting this error when baking, seems to be related to Bakery SkyLight using a cubemap, able to get the scene to bake when disabling the skyLight. Need to do more tests to see if it is the cubemap specifically.
    ---------------------------
    ftrace
    ---------------------------
    Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoHAsync( dstHost, srcDevice, byteCount, hStream.get() ) returned (719): Launch failed)
    ---------------------------
    OK
    ---------------------------
     
  47. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    How many samples are you using on the skylight? Is scene geometry really complex?
     
  48. angelo9888

    angelo9888

    Joined:
    Feb 16, 2013
    Posts:
    9
    Hello There,
    I really liked your plugin and I have to say it helped a lot.
    My only problem, and it's big, is that I get dark objects in really well lit areas. The objects are real time and the lighting is mixed with shadowmask (not distance)

    P.S. the object should just be lit by the real time direct lights but it behaves like it is in a baked scene and not in a real time or mixed one.
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Hi! Any screenshots? Did you bake Light Probes?
     
  50. angelo9888

    angelo9888

    Joined:
    Feb 16, 2013
    Posts:
    9
    Yes I did. I did like a million tests and it seems like that the problem is the occlusion probes. Although when I uncheck it some of my real time objects have wrong lighting.
     

    Attached Files: