Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

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

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

  1. yidachi123

    yidachi123

    Joined:
    Oct 1, 2017
    Posts:
    1
    Can I use it on Mac ? Only Windows?
     
  2. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Ok, I have made a repro project and tested it with the unity cubemap shader and the bakery cubemap shader (prefer your shader, by the way. You are right, Unity's exposure is not correct)

    There seems to be 2 problems:
    1- the sky light matching is not working correctly (probably ignoring the boosted environment lighting intensity multiplier)
    2- if you boost manually the bakery's sky light, the light probes just ignore it and thus end up too dark.

    LINK to the project (bakery is not included)
    The left spheres and the background is static backed. The right spheres are dynamic using lightprobes.
    No direct light. Only skybox.
    The scene is has the indirect lighting intensity set to 1.75 and a post-process stack with only the Neutral Tonemapper on an HDR camera.
     
    Last edited: Nov 19, 2018
    guycalledfrank likes this.
  3. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Unfortunately it's Windows-only.

    Definitely do that :) Will investigate.
     
  4. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    LINK to the project (bakery not included)
     
    JohnLabern and guycalledfrank like this.
  5. JohnLabern

    JohnLabern

    Joined:
    Nov 13, 2017
    Posts:
    75
    Now that @atomicjoe mentions it, I've noticed my light probes somewhat darker compared to my initial progressive tests. The difference is that my scenes are 'interiors' exposed to a totally black skybox, I hope his scene shed some light about it =)
     
    atomicjoe and guycalledfrank like this.
  6. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,116
    Hey again mate. That's very nice. That does seem to work pretty good. I do have one issue though, would Baker be able to combine the texture map and the lightmap into one? As it stands I would have to do this by hand in Photoshop for each Group.
     
    guycalledfrank likes this.
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Why would you do that? That's a bit out of lightmapping scope, and a bit of a corner case, as regular textures usually have much higher resolution than lightmaps.
    If you really have to do that, perhaps writing a script (or even recording an Action in Photoshop) is a good idea.
     
  8. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,116
    I am doing that because the project I am working on requires that I bring it into HighFidelity
    So I need to work very optimized and have the texture map and light map combined. So there is my reasoning ;)
    Sure I guess I could do it by hand/script in Photopshop but of course it would be nicer/time saver if I didn't have to. In any case, thanks :)
     
    guycalledfrank likes this.
  9. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    652
    What's the easiest way to make custom surface shaders that can use SH lightmaps?

    Can I output to Bakery/Standard rather than Standard?
     
  10. Yuki-Taiyo

    Yuki-Taiyo

    Joined:
    Jun 7, 2016
    Posts:
    72
    Thank you so much for the Sale ! I just got Bakery and I can't wait to use it. I'll see what I can do to bypass the lack of compatibility / solutions with procedural assets.
     
    guycalledfrank likes this.
  11. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    It works the same way than the built-in lightmapers. If your scene works with them, it should work just fine with bakery.
     
    guycalledfrank likes this.
  12. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    138
    I am confused about this product, please answer the question precisely.

    So this is a GPU Lightmapper which produces lightmaps. Assume a developer is using real time Global Illumination:

    Unity bakes indirect lightmaps, so this will bake that indirect lightmap. This product does not process real time GI when the game is running, but only produces lightmaps.

    I want to know, as you said Unity uses fake light fall off, so if I use this, the lightmap produced by Bakery will be superior to Unity's Enlighten/Progessive created lightmap.
     
  13. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    138
    This also means after baking is done, and that lightmap is used for real time Global Illumination, I can remove that Bakery component and run the game.
     
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    I'm just a customer but I can answer your questions: it's a light mapper just like the built-in Enlighten and Progressive light mappers in Unity. It precalculates the light into textures and apply them to your objects, so Bakery only works in the editor, baking the light into textures.
    The difference with Unity's built-in light mappers are speed and quality: to achieve the same results, Enlighten takes forever and Progressive depends on your CPU.
    Bakery uses the GPU instead, so performance will depend on your graphics card power.
    But the more important feature is QUALITY.
    Bakery removes every artifact Unity's light mappers suffer from.
    It is still in development though, so encountering a bug (like the one I posted up there) is expected and will be fixed over time.
     
    guycalledfrank likes this.
  15. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Check this image:

    Do you see those seams on the left spheres? They shouldn't be there.
    That's how Unity built-in light mappers behave. Bakery fixes this kind of things and is more precise with lighting.
     
    JamesArndt likes this.
  16. Yuki-Taiyo

    Yuki-Taiyo

    Joined:
    Jun 7, 2016
    Posts:
    72
    Okay, so...

    I tried Bakery on a simple empty room and it upsets me as the best quality Lightmap I could bake is already 16 Mo - and light seams are too visible on blank walls. Considering I have a massive amount of assets to make for my procedural levels, I fear I won't be able to keep up with it.

    I have to conclude Lightmaps are not suited for my project...

    I think I was a little compulsive buying it knowing I have no experience with Lightmapping, and I would like to know if a refund would be possible.
     
    Last edited: Nov 20, 2018
  17. zornor90

    zornor90

    Joined:
    Sep 16, 2015
    Posts:
    178
    Hey @guycalledfrank out of curiosity, how do you plan on handling prefabs of prefabs? Especially in Unity 2018.3 we are going to be prefabbing almost everything (doors, furniture, sections) into a single main prefab, but we are currently getting this error on the Prefabbed Lightmap Component:
     
    guycalledfrank likes this.
  18. YuanHuaxu

    YuanHuaxu

    Joined:
    Apr 22, 2013
    Posts:
    1
    When I use bakery package in Android platform.The bake result is not correct. bug1.jpg bug2.jpg bug3.png
     
  19. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    205
    It's a texture compression, ETC1 are relay bad. Just use ASTC.
     
    guycalledfrank likes this.
  20. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    That's a bit tricky. Surface shaders in Unity don't really expect you to calculate baked lighting, they usually just receive surface properties and apply lighting on their own. Adding SH to a custom non-surface ("unlit") shader is more viable.
    Perhaps it's easier to just extend Bakery shaders to do what you need.

    Almost correct. It can bake a lot of stuff apart from just indirect lighting, but does nothing about real-time GI.

    Physical falloff is optional. You can:
    - Bake everything using standard Unity falloff.
    - Bake with physical falloff, but use standard real-time lights.
    - Bake with physical falloff AND use the Shader Tweaks window to patch engine shaders, so real-time lights also use the same physical falloff.

    Sorry, didn't get it. Baked lightmaps are baked, they have nothing to do with real-time GI.
    But yes, Bakery components don't do anything in the game, they are only useful to pass settings during the bake.

    Can you show the seams? There are various kinds, and they can have various reasons.

    It's possible of course. But perhaps the problem you experience can be easily fixed.

    That's some very new stuff, I didn't properly play with it yet. I'm not sure how it works exactly, but will look into it eventually, as it's something I wanted from the engine for a long time.

    Do you mean the quality? Visible banding? That can happen due to rather low quality compression Unity applies to mobile lightmaps. I suggest playing with compression settings on lightmap assets. Just in case, try disabling the compression completely and see if there is noticeable difference in quality.
     
  21. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Yeah, you're not alone... That's an essential NEED for me...
     
    guycalledfrank likes this.
  22. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    I had a bad time with ASTC: compression takes FOREVER and can eventually crash Unity. It even ended corrupting the library and I had to remake the project from a new one...
    It has an excellent quality/size ratio though.
     
  23. Jan_Hasse

    Jan_Hasse

    Joined:
    Sep 11, 2017
    Posts:
    17
    Hello Guys,
    ive baught Bakery today. Its fantastic, thank you for your work.
    But i have one question.
    I have many non-static Objects inside an static room.
    The player need to interact with them. I tried to use light-probes to let the non-static objects look correct.
    But the Light-Probes seem to ignore the shadows in the Szene. Is there trick to let the light-probes receive the baked shadow, or how can i use them with bakery? I already tried baked them with bakery.

    Thank you. Greetings

     
    guycalledfrank likes this.
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Yes, check the "Occlusion probes" checkbox. As described in the docs:

    Occlusion probes checkbox: when Render Light Probes is pressed, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes prevent dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.
     
  25. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Ok, I have a big bug now when rendering in directional mode using Dominant Direction + Denoiser:



    The bug doesn't happen if I disable the Denoiser:


    And it doesn't happen neither when I bake normalmaps and enable the Denoiser:


    This isn't affected by any other options. (I have tried)
    Also, this happens whether or not you actually use normalmap textures in your materials.
    Nvidia GTX1080 drivers V416.94
     
    guycalledfrank likes this.
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    So I've just checked the project and while I managed to match the overall intensity (using the match button), Bakery light probes don't appear shadowed where Progressive probes do.
    Environment intensity multiplier is ignored during both lightmap and probe baking, so it shouldn't affect any sort of mismatch between them.
    There might be some difference between weights Unity and Bakery apply to different probe coefficients. I'll investigate it further, but I never noticed any significant difference on real game scenes.

    Hmm I can't reproduce this one on your project. Perhaps there are other factors at play apart of directional mode/denoising?

    upload_2018-11-20_20-50-23.png
     
  27. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Well, my game is using this exact type of lighting (only sky light) and I noticed right away the problem with the light probes being too dark overall. That's the reason I needed a much higher quality lightmapper than Unity's, to fix any seam or weird thing on my diffuse lighting. ;)

    About the Directonal Mode, I have tested it several times and even rebooted my PC just in case something in the graphics card drivers got mad. I will retest it again nevertheless.
     
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Well they shouldn't be too dark. Looks like this if I use the match button:


    upload_2018-11-20_21-1-15.png

    Updating the GPU driver might be a good idea. Denoiser uses some very fresh nvidia tech.
     
  29. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    It's the latest one: 416.94 11/13/2018
    Maybe you are not on the latest one?
     
  30. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    That's much better, yes! :p
    I see the differences in the shadows, but I think bakery's version is actually more accurate:
    Since neither of the two balls on the right are contributing to the shadowing, they shouldn't be shaded so dark underneath, as Unity do. I believe your calculations are correct.
     
    guycalledfrank likes this.
  31. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Well.. that's true, I'm not. I wonder if they actually broke it in the newest version (?). Can you send me your denoised directional lightmap files (TGA), in case there is some known buggy pattern?
     
  32. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    I'm downloading old drivers to test them.
    Here you go, LINK to the generated maps.
     
    guycalledfrank likes this.
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Yeah, there is definitely some weird corruption happening, left is mine, right is yours:

    upload_2018-11-20_21-43-49.png

    I'm on 397.93.
     
  34. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    What's weirder is, it's slightly different each time I render it... o_O
     
  35. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    That's not really weird, the noise is randomized differently every time you bake, and so texel dilation + denoise result can give slightly different edges. But in your case there is a whole large chunk of incorrect data...
     
  36. jroma17171

    jroma17171

    Joined:
    Jul 3, 2018
    Posts:
    6
    Hey! I plan on purchasing Bakery very soon and I'm running on an RTX 2080 Ti. Does Bakery utilize the ray tracing acceleration/OptiX or are there any plans for that in the future?
     
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
  38. jroma17171

    jroma17171

    Joined:
    Jul 3, 2018
    Posts:
    6
    guycalledfrank likes this.
  39. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    I have tested several drivers versions and I'm currently using the same as you: 397.93
    Still the same issue: the directional lightmaps get corrupted but only when using the denoiser.
    However the denoiser works perfectly as long as it's not on directional lightmaps...
    I'm on Unity 2018.2.16f1 on which version are you?
    This is very weird...
     
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Tested on 2018.2.2, but I don't think it has anything to do with Unity version. That's a very odd bug indeed, as I can't reproduce it anywhere, and I don't know anyone else who can. The only difference between directional denoising and regular denoising is that I denoise each channel of the directional map separately.
    In fact it looks as if parts of pixels from one channel got randomly copied over other channels.
     
  41. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    I have a dynamic time of day. Can I still use this?
     
  42. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    Probably not. But if you can somehow have dynamic time of day with built-in progressive lightmapper, then you'll be able with Bakery.
     
    ksam2 likes this.
  43. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,014
    Don't know why but Enlighten is a lot faster for me than progressive mode.
     
  44. c_agwill

    c_agwill

    Joined:
    May 31, 2017
    Posts:
    4
    Excited to start using this. I'm no Unity expert, but I'm running into an error and getting the same in the example scenes. Upon hitting render the Bakery UI window goes blank. There's no process running in the editor afterwards and as you can see from the error, no progress bar. Any help would be very much appreciated!
    Currently using 2018.2.5, but have also tried 2017.3.1 and 2018.2.15

    DllNotFoundException: simpleProgressBar
    ftBuildGraphics.ProgressBarInit (System.String startText, UnityEditor.EditorWindow window) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:739)
    ftBuildGraphics+<ExportScene>c__Iterator0.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:883)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2571)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2468)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)
     
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    819
    Ok, after much trying, I have found the source of the bug:
    If I set the Min Resolution to less than 512 when using Directional Mode Dominant Direction + Denoiser, the lightmaps get corrupted.
    As long as I keep the Min Resolution to 512 or more, everything is fine and it renders everything perfectly!
    I don't know why, but that's how it works on a GTX1080.
    I have tested lots of drivers versions, tried with Unity beta versions, and I was even worried it could be my graphics card memory. I have downclocked my GPU, it's memory and put the fans at full blast.
    I have lowered my screen res, disabled any graphic layer that could interfere like Steam, GeForce ShadowPlay....
    NOTHING changed it. Except when I raised the Min Resolution to 512. Then everything was fine.

    This bug is only happening with Directional Mode = Dominant Direction + Denoiser and min resolution <512
    Disabling the denoiser fixes it. So it must be related to the denoiser, somehow.
     
    Last edited: Nov 20, 2018
    guycalledfrank likes this.
  46. zornor90

    zornor90

    Joined:
    Sep 16, 2015
    Posts:
    178
    I gotcha, yeah once my team and I release our next general build we are going right to 2018.3. This error is happening on 2018.2, tho, even when the prefab has been fully applied - would there be problems if we just disabled that error check on the component? We do make sub prefabs but when we bake, we have dragged the entire prefab we want to bake on in the scene and applied it first

    EDIT: The error message I'm talking about is on lines 65-66 of BakeryLightmappedPrefab.cs, this seems to happen even after applying changes and the prefab is blue, especially when we use Odin serialization or custom serialization
     
    Last edited: Nov 21, 2018
    guycalledfrank likes this.
  47. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,005
    I have just bought this because I am sick of waiting 3 days to bake my scene in unity ;-) I cannot wait to try it out! I was so bored waiting for unity to finish the bake I was googling alternative lightmappers and found this, I am extremely excited to try it on my absolutely ludicrously large city scene!.. Looks great, I am going to try and make a video showing the differences between enlighten and bakery results.

    Just one question, it does not support realtime GI, does this mean that if I have a point light that changes colour at runtime then it won't work? I must be honest even though I've spent literally *years* researching lightmapping with unity I still don't fully understand it much lol, what I do know is baked light looked AWFUL in unity for me, so I had to go realtime gi. I am assuming if Bakery makes my scene look good then it will also run quicker than using unity's realtime gi?

    Anyway great work thanks! Cannot wait to try it out!! On sale right now too, woot :)

    PS. I have GTX970, is it good enough? Shall I go for a 1060 or 1080 ?
     
    guycalledfrank likes this.
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,005
    buy it during sale, dont miss out :)
     
    guycalledfrank likes this.
  49. Yuki-Taiyo

    Yuki-Taiyo

    Joined:
    Jun 7, 2016
    Posts:
    72
    In fact, since my interior levels should be mostly glossy in aspect (not to say my rooms are quite large too), I think Lightmaps are not usable for what I need to achieve sadly, and the files size is a dead end for my project.
    Thanks for allowing a refund. I let you contact me to do so.
     
    guycalledfrank likes this.
  50. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,305
    It's just Enlighten doesn't just bake regular lightmaps, but a special data that can be used to relight the scene at runtime, so it can be used in dynamic time of day scenarios. Progressive and Bakery are focused on high quality static lightmap textures.

    Well that sounds simply like you didn't import all necessary files. Do you have Assets/Editor/x64/Bakery/simpleProgressBar.dll?

    Min resolution is 16 by default, and I only tested with that. Other resolutions don't seem to change it on my machine, and generally it only affects the way atlases are packed.
    A little experiment: https://drive.google.com/open?id=171FhBVvEvzIIZVq2sW0TOqnj0VwXuq6F
    Try replacing denoiseDir.exe with this one. It will completely re-initialize the denoiser between channels. I wonder if it will help.

    The "error" is just to prevent you from applying unwanted changes to the prefab (I'm extra paranoid about breaking assets). So you may as well try removing the check :) Open BakeryLightmappedPrefab.cs, and just add "return true" to the IsValid() function.

    You'll need this point light to be real-time (not baked), and it won't produce bounced lighting. Bakery can generate bounced lighting, but it won't change color dynamically, it will be just baked into a texture (just like Progressive).

    Enlighten real-time GI is likely more expensive than Bakery/Progressive, because it has to regenerate lighting at runtime, and I doubt it has time to apply any texture compression to the result.

    Yeah, it's a fine card, maybe a bit limited in terms of memory, but still very usable. I actually started developing Bakery on 970, then moved to 1060.
     
unityunity