Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Anything in this regard coming up sometime soon?
     
  2. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I also made a script to fix the disappearing directional lightmaps automatically when saving and recompiling scripts.
    You should include it in Bakery by default:

    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEditor;
    6.  
    7. public class ftBakeryDirectionalReloadFix : UnityEditor.AssetModificationProcessor
    8. {
    9.     // Start is called before the first frame update
    10.     static string[] OnWillSaveAssets(string[] paths)
    11.     {
    12.         ftLightmaps.RefreshFull();
    13.         return paths;
    14.     }
    15.  
    16.     [UnityEditor.Callbacks.DidReloadScripts]
    17.     static void OnScriptsReloaded()
    18.     {
    19.         ftLightmaps.RefreshFull();
    20.     }
    21. }
    22. #endif
    23.  
    Simply save this as "ftBakeryDirectionalReloadFix.cs" inside bakery's editor folder and that's it. :)
     
    hippocoder and guycalledfrank like this.
  3. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I prefer written manuals though: videos are long and too specific. They are good for simple tutorials but I hate it when people make videos instead of written manuals because there are plenty of things that don't get covered in detail.
    So kudos to Bakery for having a great written documentation.
     
    hippocoder and guycalledfrank like this.
  4. Divossen

    Divossen

    Joined:
    Jan 11, 2016
    Posts:
    1
    Hi!

    I'd like to use Bakery for several projects. Is there a way to install the large Bakery DLLs locally, somewhere next to the editor? So that we don't have to put in hundreds of MBs of DLLs into each of these projects (and keep them from being pushed into version control).

    Best,
    Claus
     
  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Thanks, added it. I guess legacy probe render is more of your code than mine at this point, heh

    Not yet :(

    I can, but I'm not sure why I can't repro it. Did you check if it's related to the lighting data asset being reloaded (without it)? Maybe I can fix it instead of patching it every save/recompile.

    Hint: the largest DLL is cudnn64_7.dll, and it's only used by OptiX 5.1 denoiser (together with optix_denoiser.51.dll). If you use any other denoiser, you can remove it.
    OpenImageDenoise.dll and optix_denoiser.6.0.0.dll are second largest DLLs and they are only used by the respective denoisers.
    I guess you can also try putting them to system32 folder instead.
     
    Meltdown likes this.
  6. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I was wondering: why is the Open Image denoiser the prefered option over Optix, since it's way slower? Is it better quality?
     
  7. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Not really, I only putted a turbo in there, but you made the car ;)
    Also, about the scramble bug, I completely removed the multi-threading code because at first I thought it could be related to a race condition using threads, but it didn't fix it, so the bug was either always there since the beginning or it's a new unity bug introduced recently.
    I didn't. What should I do specifically to test it? delete the lighting asset of the scene?
     
    guycalledfrank and hippocoder like this.
  8. Lewcy

    Lewcy

    Joined:
    Feb 26, 2021
    Posts:
    5
    ill check it out thanks!
    Just so you know i couldnt bake even if i tried, it gave me denoiser errors then too
     
  9. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Thank you for your further investigations. Yes i read that article.
    As stated before, i'm using URP with lit shader :). Which seems to use a different tangent basis, or shader decoding whatever, than built-in. I used Substance Painter and there I have to check "Compute Tangent Space Per Fragment" to get the correct normal maps.
    It has to be unchecked for built-on and checked for URP/HDRP.
    So something is different in normal maps handling between built-in and URP/HDRP
    Look at my "soft" cubes with URP lit shader with real time lighting and high reflection. My normal map is definitely fine.

    You can read about it on bgolus article at "MikkTSpace vs MikkTSpace?"
    "But when using tangent space the bitangent is recalculated either per vertex or per pixel."
    So i assume per vert in built-in and per pixel in SRP's.:rolleyes:
     
    Last edited: Mar 2, 2021
    guycalledfrank likes this.
  10. Lewcy

    Lewcy

    Joined:
    Feb 26, 2021
    Posts:
    5
    It worked!!! thanks so much!
    upload_2021-3-1_23-56-54.png
     
    guycalledfrank likes this.
  11. hubrobin

    hubrobin

    Joined:
    Jan 25, 2016
    Posts:
    5
    Hey!

    I'm having some issues with clearing bake data. Or at least it's not super clear to me what the workflow should be.

    If I use Bakery Utility option to clear them, they still stay there on the disk. Scene lighting also changes, but its by far not completely cleared. Then when I use Unity Lighting window 'Clear baked data' the scene is properly cleared and only realtime lights are now contributing. That only holds till I enter play mode or reload the scene, so I guess something doesn't get dirtied properly. If I use Unity to bake lightmaps it all works properly and clearing baked data also deletes everything from disk.

    Any insights?

    Unity version: 2020.2.6f1
    Bakery version: Latest from github (also tested just latest from Asset Store)

    Cheers,
    Robin
     
    guycalledfrank and atomicjoe like this.
  12. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    35
    Small (hopefully!) feature request - can we have some controls to silence the excessive logging please? Especially when triggering Bakery bakes via scripts and a custom build process, the Bakery logs tend to drown out everything else, and there's a lot of debug info that's not really helpful for an end user. Additional there are some Debug.Log entries that look like they should be Debug.LogError and vice versa.

    // Ideally it'd be cool to be able to do something like:
    ftRenderLightmap.logLevel = LogLevel.ERRORS;
    // or
    ftRenderLightmap.logLevel = LogLevel.WARNINGS | LogLevel.ERRORS

    It's particularly awkward when using any kind of build tool (eg. Jenkins) as they often scrape log files for trigger words like 'warning' or 'error' and that can cause false error report and aborted builds.

    Thanks.
     
    guycalledfrank and atomicjoe like this.
  13. hubrobin

    hubrobin

    Joined:
    Jan 25, 2016
    Posts:
    5
    A little bit of an update here. Spent an hour debugging Unity source and it seems that the problem with Unity Lighting Window 'Clear Baked Data' not working is due the the fact that baked data belong to a scene named '_tempScene' and not to the scene they are used in. Gonna spent some more time debugging this, but the behaviour is a bit undefined for the lack of a better word :/
     
  14. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Is it normal that lightmapped prefabs take FOREVER to light bake ? I made a test prefab with two objects in it and one directional and one sky light in the scene, and it took about 10-15 minutes to complete (most of it at the last step of the process).
    I use 2020.2.3f1, URP 10.3.1 and have a ryzen 5950x and RTX 2070 Super so bakes usually go super fast. I am going to try things but if anybody here has some clues or similiar experience, please speak out :)
     
  15. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    So i kinda fixed it somehow. After a few tries were it took forever, it does now stay at the last progress stage forever but when i click somewhere in the editor the progress window goes away and everything is fine. I also updated Bakery from the github repositories, but i am not completely sure if that was what fixed it.

    @guycalledfrank are there any good to know facts about lightmap prefabs ? The documentation on it isn't particular extensive, and maybe you still have some valuable knowledge to share that isnt written down there. Anyways thank you so much for this amazing addon :) !

    If you need something to add to your roadmap:
    I would love to be able to do stuff like baking ao, curvature, thickness into RGB of a secondary Lightmap and use it in shaders or add one of those maps into the Alpha Channel of normal lightmap. Maybe like a custom meta pass where you can just overwrite individual channels of the lightmaps and insert custom data.
     
    Last edited: Mar 1, 2021
    Felinde, guycalledfrank and atomicjoe like this.
  16. eewill

    eewill

    Joined:
    Oct 11, 2019
    Posts:
    2
    I have some models with generate lightmap UVs checked. When I bake the scene I have "Adjust UV Padding" set in Bakery and the bake looks great.

    But when I leave the scene, then reload it, I have to use Bakery -> Utilities -> Readjust UV Padding every single time to get the lighting to be correct. How do I get it to stick?

    UPDATE: Searched this thread and realized it's probably because I'm using the same model in multiple scenes. I guess I will turn off both the Generate UV and Adjust UV, and make sure the UVs are actually correct on the model itself

    UPDATE2: Just noticed the Bakery -> Utilities -> Save UV Padding to asset , so now I'm all set :D
     
    Last edited: Mar 3, 2021
    guycalledfrank likes this.
  17. NotoMuteki

    NotoMuteki

    Joined:
    Feb 8, 2018
    Posts:
    42
    I imported 3rd Party Building Asset which baked lightmaps with Bakery.
    https://assetstore.unity.com/packages/3d/environments/event-3-185841

    When I tried to re-bake lightmaps by Bakery menu, this error stopped baking.
    Error: Can't load lightmap to compose. See .ftracelog.txt for details. (91)


    So I looked into .ftracelog.txt, progress has been stopped with this message.
    Can't read texture C:\Users\SATOSU~1\AppData\Local\Temp\frender\probes_final_RNM0.lz4


    What does this mean?
    I didn't get any errors like this in other scenes' baking.

    Unity version:2020.2.6f1
    HDRP:10.3.1
    Bakery:1.8

    Here's the setting of Bakery.
    setting.png
     
  18. NarryG

    NarryG

    Joined:
    Mar 11, 2020
    Posts:
    10
    Are you using the same bake mode in all scenes? I haven't tested with Bakery, but with Unity's built in lightmapper, if you mix directional & non-directional lightmaps with additive scenes, it gets upset.
     
    guycalledfrank likes this.
  19. NarryG

    NarryG

    Joined:
    Mar 11, 2020
    Posts:
    10
    I have a scene here that's not super complicated. Progressive GPU can bake it in about 7 minutes. Bakery fails to bake it at all. It crashes my GPU driver after a while (~45 minutes)

    If I try using RT-Preview, it eats up my VRAM, all 10GB on my 3080. Really not sure why it's having so much issue with this scene. It is an outdoors scene, but again, this is a scene that Progressive can bake in ~7 minutes. if I lower the resolution, RT works. Baking is still far slower than progressive with comparable settings.
     
    Last edited: Mar 6, 2021
  20. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Hello, I'm having trouble baking correct light probes with Bakery.

    Here is a light probe in the shadow when baked with Bakery:

    As you can see, the light probe in the shadow incorrectly has full lighting.


    Here is the same light probe when baked via the built-in CPU progressive light mapper:

    As you can see, the light probe in the shadow has the correct lighting here.

    How can I fix light probes when baking via Bakery?

    Here are my Bakery settings:



    I'm currently just pressing the "Render" button to render the lightmap + bake light probes.

    And when I instead try the "Render Light Probes" button, I get this error:



    even if I had just did the full bake via the main "Render" button.

    Is there something I have to do to get light probe baking working correctly with Bakery?

    I'm using an RTX 2060 to bake.

    Thanks

    *EDIT*
    On further testing, it seems that baking in Full Lighting mode will properly bake light probes. But I need to bake with Shadowmask mode, and still have properly baked light probes. Unity's default CPU Progressive light mapper is able to bake light probes in Shadowmask mode, why can Bakery not? I can't use Bakery if I cannot bake light probes in Shadowmask mode :(
     
    Last edited: Mar 6, 2021
  21. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    Hi MrF !
    Is it possible to do the BakerySHGraph for LayeredLit in HDRP?
    I'm trying to texture the level using vertex color as a Mask.
    I was trying to create LayeredBakerySHGraph but failing...
     
  22. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    I just bought your asset. Can I just say thanks? It really is a wonderful world where someone can build a lightmapper that just works and is fast without having all the resources Unity has at their disposal.

    Thanks man, it makes light baking legit fun.
     
    guycalledfrank and atomicjoe like this.
  23. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    198
    I used basic settings for creating lightmaps on the scene, but now, dynamic objects (cars) are really dark, am I missing something?



    The funny thing is that it's only happening on odd runs.
     
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    - It's usually slower on the first run, following calls are faster.
    - It can be other way around in case you have a very slow CPU (OpenImageDenoise is CPU-based).
    - I gave it priority mostly just because I (and everyone else) used it before for their scenes, so upgrading/rebaking won't change the result.
    - But their quality is comparable, both are very good. I think OpenImageDenoise is a bit more aggressive, so it can kill stronger noise, but on the other hand it can somewhat overblur some small/dim indirect shadows.

    Maybe I should make it more clear in the recommendation window, hmmm...

    Yes, or unassign it. Just see if it behaves like this when it's not present.

    Oh. I didn't know URP uses a different tangent space. That's a terrible decision actually, meaning devs can't port their assets from standard RP to URP properly. Does it mean that Asset Store assets have to include 2 versions of the normal map?... I'm afraid both those producing the assets and using them are unaware of it.

    But you're right, even the bgolus' link mentions "for HDRP, and soon for URP.", I guess that "soon" has come (I wonder if it just broke all normals in pre-"soon" projects?...)

    Anyway, I've just pushed a patch to github, it should now check if "RenderPipeline" tag is set to "UniversalPipeline" or "HDRenderPipeline" on the shader (which is true for all default SRP shaders and graphs) and then automatically use per-pixel tangent space for Baked Normal Maps. Seems to work:

    upload_2021-3-7_14-10-41.png

    It clears any baked data references from the scene, but it doesn't actually delete the files. I could make it delete the files, but... I didn't do it because I'm too afraid of deleting something by accident, and another problem is that you can reuse some lightmaps over multiple scenes (e.g. by using Lightmapped Prefabs). If by "not completely" you mean that, then your observation is correct. But if you mean that the scene still looks differently and something is not visually cleared, then I'd like to see some screenshots, it might be a bug.

    Anyway, it's time to finally update it, so I did (check github).

    1. Clear menu now has more options:

    upload_2021-3-7_16-21-8.png


    2. ftAdditionalConfig.cs now has this flag:

    upload_2021-3-7_16-21-44.png


    Setting it to true will make Bakery automatically delete previous lightmap files before a new bake.

    Makes sense, added this to ftAdditionalConfig.cs:

    upload_2021-3-7_16-52-32.png

    I left error logging untouched though, these are usually too important to skip...

    No. There is no particular difference in baking a scene vs a prefab. There is one tricky workaround at the end of the bake though:

    upload_2021-3-7_17-0-51.png

    ... tried clicking the editor window when the progress bar is at 100%?

    Ah yes. Exactly what I thought.
    I'm still not sure WHY thing workaround worked (and why I didn't need it on previous versions of Unity), but at least it worked.

    What would you like to know about them?

    Maybe you can use more specialized software for that, e.g. xNormal, Substance, Marmoset? But I understand it could be useful to make Bakery put e.g. AO to a separate channel or write a little script to do the same for thickness (you can bake thickness as AO on an inverted mesh). What would be cool is to provide some compact API to be able to define your own passes and final channel layout, and I was thinking about that...
     
    Felinde likes this.
  25. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Can you go to Experimental settings and make sure that these checkboxes are active? They should be:

    upload_2021-3-7_17-10-30.png

    My bet is that they are not comparable. To compare them properly:
    - Compare texel density in "baked lightmap" view VS Bakery's "checker preview" mode. Even with identical "texels per unit" value it can be rounded/stretched/packed a bit differently, so it's important.
    - Compare sample count in progressive VS Bakery (GI, Skylight). Note that Bakery's sample count is a square root of the actual value, i.e. Bakery's "32 samples" == Progressive's 1024 samples.
    - Make sure you have RTX mode enabled if you're on RTX hardware (!)

    I bake this scene ([1], [2]) in 12 minutes on GTX 1060, it's a bit larger than a football field, with multiple buildings, some having simple interiors, half of the objects using SH lightmaps, everything having a shadowmask + scene-wide Volume.

    Use Occlusion Probes checkbox: https://geom.io/bakery/wiki/index.php?title=Manual#Occlusion_probes
    It basically saves a single-value shadowmask into probes.

    Try updating from github.

    I guess I answered you (was it you?) via email yesterday? :D

    Thank you! :)

    Hmmm do you have light probes? Or volumes? Did you fully bake your lights?
     
  26. NotoMuteki

    NotoMuteki

    Joined:
    Feb 8, 2018
    Posts:
    42
    Thank you so much! I enabled those checkboxes and now it's baked without errors!
     
    guycalledfrank likes this.
  27. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    This works for right after render! Right after render, the lightmap and light probes are 100% correct. But when leaving then scene and then returning, a lot of lighting data (probes, and some parts of the lightmap) is incorrect. And then when I delete the LightingData.asset, the lightmap will once again be correct, but the light probe data is of course completely lost.

    The light probe data is perfect after render with Occlusion Probes checked. Is there some way I can get that data saved when returning to the scene?

    Thanks

    *EDIT*
    Ok, so deleting the 16x16 shadowmask generated by the default lightmapper has fixed the issue!

    Now I have proper Bakery lightmaps and light probe data! Thank you!
     
    Last edited: Mar 7, 2021
    guycalledfrank likes this.
  28. barcode802

    barcode802

    Joined:
    Apr 6, 2014
    Posts:
    36
    Is there a way to specify if a baked light map texture is compressed or not? I noticed that I'm getting very pixelated light maps on some surfaces even though I'm dialing up all of the settings to the maximum. With Unity's light baking when I had this problem - turning off compression solved the issue. Does bakery have that option - I don't see it in the settings? I also tried making sure that the unity scene light baking settings were set to not be compressed in case bakery is also using that setting. Here's an example of the issue: upload_2021-3-7_21-52-41.png

    another example:
     

    Attached Files:

    Last edited: Mar 8, 2021
  29. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    The Optix denoiser has given me some banding problems in the past.
    Try using the Open Image Denoiser instead and share your results with us.

    Also, the lightmaps are saved as HDR images that on import can be converted to "dLDR" or "RGBM" encoding (not related to the texture compression), which doesn't have enough precision to do smooth gradients without color banding:
    https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html

    You can change that on the unity lightmaps settings. (see the manual link up there)
     
    guycalledfrank likes this.
  30. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I don't think a Ryzen 3900X overclocked qualifies as a very slow CPU, so I guess Optix is super fast instead :p
    I guess a CPU can't compete with a fast RTX GPU, because Optix has been blazingly fast for me both on an RTX2070 and an RTX3090 now. It was much slower on a GTX1080 though.
    But Optix has given me some headaches with quantization and some kind of weird vertical line dithering on very low lighting zones in the past.
    Maybe it was because I was using dLDR encoding or something. I'll have to recheck that, now that Unity supports ASTC_HDR on Android.
     
    guycalledfrank likes this.
  31. CmartinezSaltoki

    CmartinezSaltoki

    Joined:
    May 21, 2020
    Posts:
    10
    Hello!
    My team and I find ourselves reimporting a significant amount of baked models (shared in the majority of our project's scenes) quite often when we clear our project cache or even when we update Unity's version. Is there any way of having all these models reimported automatically instead of checking them one by one?
    Thanks in advance, Frank!
     
    guycalledfrank likes this.
  32. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hey, thanks for this update !
    Yes i guess that's what it means. I'd like to think they had a good reason to change it tho. This our first project with URP (and i'm not impressed) and luckily we didn't have to convert (downgrade :D) from built-in.
    People used broken tangent space pipelines for years, so now it's just like horrible old times.
     
    guycalledfrank likes this.
  33. Jerremia

    Jerremia

    Joined:
    Nov 26, 2018
    Posts:
    15
    Hello fixed one problem and got a new one now too....
    For the record previous problem was due to a material having baked emissions enabled and that caused all my artefacts. I didn't want to deal with the issue so I just disabled the baked emissions which were not at all important to have.

    Fast forward, now i'm adding a lot of static cars to my scene (also with LODs), and they're quite high tris in count (200-350K on LOD0).

    The problem is when I bake I get this error (errors are in order) at "Exporting scene - alpha buffer";
    Can't create scene vertex buffer
    Can't load scene to UVG8
    Can't render UV GBuffer, bacause no scene is loaded
    Can't render UV GBuffer
    ftRenderUVGBuffer error: 1

    The same errors happen when I replace the car models with LODs to ones that don't have LODs. It seems like the error happens at X amount of cars, if I disable one suddenly the bake works. But if I add one more boom I get the errors described above.
     
  34. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    113
    started a new URP project in unity 2020.2.4 getting this error
    Shader error in 'Shader Graphs/BakeryURPDirSpec': 'SAMPLE_TEXTURE2D': Too few arguments to a macro call. at Assets/Bakery/shader/ShaderGraph/URP/BakeryDecodeLightmap.hlsl(83)
     
    guycalledfrank likes this.
  35. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Unity broke backwards compatibility of URP on a new version?
    I'm shocked!
     
    peeka likes this.
  36. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    113
    I updated to 2020.2.7 seems to be fixed.

     
    guycalledfrank likes this.
  37. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Now I'm really shocked! :D
     
  38. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    113
    after I bake the error come back :(
     
    atomicjoe likes this.
  39. Level3Manatee

    Level3Manatee

    Joined:
    May 10, 2018
    Posts:
    10
    Hi, are there any plans to increase the maximum ray tracing path length / bounces? Currently working on a project where 5 GI bounces are not enough for the subtle effects I want to achieve. Alternatively, I'd be happy to just patch the interface to allow for more bounces, if that would do the trick ;)
     
  40. mbarbaric_2

    mbarbaric_2

    Joined:
    Oct 31, 2020
    Posts:
    5
    hello, I-d need a helping hand from some good soul. I use the URP and after baking, I get these strange spots on the window frame. if I use area light it is even more prominent. bakery settings are also visible.
    artifacts.png

    I-ve tried using hdri without sun (as troubleshooting for "fireflies" suggests) but that didn't help. In the lighting environment I've used material that came with unity HDRI (https://assetstore.unity.com/packages/2d/textures-materials/sky/unity-hdri-pack-72511) and it already came with prepared HDRI cubemaps. I've also updated the skybox to match the new lighting environment but no luck.
     
    Last edited: Mar 11, 2021
  41. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    The problem is a lack of samples on indirect light and it's visible because you have Indirect Boost set to 5 times the default (1).
    You'll have to either increase the Global Illumination samples from 16 to 32 or 64, or lower the GI bounces to 3 or 2.
    The thing about GI bounces is: the more the light is allowed to bounce, the less rays reach those later bounces, so you can have enough samples for regular lit areas but spots like this on dimly lit areas.
    Increasing the indirect boost makes this even more noticeable, since it doesn't assign more rays to those zones, it only increases the brightness of the rays that reach them.
    You can also try to use the Open Image Denoiser, which is more aggressive than Nvidia's Optix denoiser.

    tldr: set GI Samples to 32, lower GI Bounces to 3, use Open Image Denoiser
     
    guycalledfrank and mbarbaric_2 like this.
  42. mbarbaric_2

    mbarbaric_2

    Joined:
    Oct 31, 2020
    Posts:
    5
    how i love you in this moment!!!!!!!
    thanks a ton!
    atomic indeed
     
    atomicjoe likes this.
  43. CenturyLin

    CenturyLin

    Joined:
    Jul 14, 2019
    Posts:
    3
    can someone give me some advise?
    when i use bakery to bakery a scene with black ground,white box and yellow directional light, there are always some red green and other color point in the lightmap, how can I fix this? is this the artifact cause by ray tracing?
     
  44. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It can be caused by the texture encoding and compression applied to the lightmaps when Unity imports the lightmaps textures (hence not Bakery's fault) or it can be you are rendering with too few samples (rays).

    Try this:
    1- set the Lightmap Enconding to HIGH QUALITY in the Player Settings
    2- crank up the GI Samples in Bakery to 32 or more and render the lightmaps
    Check the results and let us know :)
     
  45. varstudio

    varstudio

    Joined:
    Mar 12, 2021
    Posts:
    2
    Hello:) Can I use it for baking lightmaps in HDRP anybody knows? I have added bakery light scripts to lights, skylight so in Preview it looks good, but when i push Render button it do it's job and beeps like everything fine. But the result is completely blank lightmap. Maybe i did something wrong? Unity 2020.2.3f1, Bakery is up to date

     
    Last edited: Mar 12, 2021
  46. mbarbaric_2

    mbarbaric_2

    Joined:
    Oct 31, 2020
    Posts:
    5
    most certainly you can and it produces really good results. I'd suggest you check troubleshooting guide https://geom.io/bakery/wiki/index.p...ok_black_or_have_bad_quality_in_an_HDRP_scene

    check this part, it helped me at least.
    Lightmaps look black or have bad quality in an HDRP scene
     
    guycalledfrank likes this.
  47. varstudio

    varstudio

    Joined:
    Mar 12, 2021
    Posts:
    2
    Thank you man, it really helps. I might never have realized my settings are wrong. I have divided Bakery "Match Lightmapped to real-time" light intensity by 100
     
    Last edited: Mar 13, 2021
  48. CenturyLin

    CenturyLin

    Joined:
    Jul 14, 2019
    Posts:
    3
    thx for your answer:),but i still confuse when i try to fix it. upload_2021-3-13_23-29-14.png
    if i use white ground, the lightmap are beautiful, but when i use black ground, as you see in the pic, a lot color noise at the edge of box. this is my setting.
    upload_2021-3-13_23-35-20.png
    i know than setting bounces to zero and adjust uv padding can reduce the color artifact but it still unacceptable.
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Weird! Is it generated every time you bake? If so, I can try clearing it automatically.

    On your screenshots the problem is not just the pixelation, but likely Unity being in dLDR mode. Here is the list of things you can check: https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good

    This pattern? https://geom.io/bakery/wiki/index.php?title=Troubleshooting#Denoiser_produces_grid-like_patterns

    Do you mean
    - You clear project's Library folder (any particular reason for that?)
    - Assets are reimported, but baked models don't look right
    - You reimport them one by one, and the UVs are fixed
    ?
    Just tried it, can confirm it happens.
    ...
    So the problem was that the Asset Database was not fully initialized when you launch the editor and when it starts importing stuff right away. My model postprocessor was trying to load ftGlobalStorage via LoadAssetAtPath, but it failed, so it skipped the model. Manual reimporting worked, because the Asset Database was now initialized.
    However, because the same data is also reflected in *.meta files of the models on the majority of Unity versions Bakery supports, I didn't actually need to depend on ftGlobalStorage...
    ...
    Anyway, I've just pushed a patch to github! Seems to fix the issue in my tests. Please try it :)

    Both of those spaces are valid, they are just different. It's just important that baking tools use the same as the engine. I guess they did it because the majority of existing tools leans towards per-pixel...

    Yeah, this one is covered here: https://geom.io/bakery/wiki/index.p...et_a_.22Can.27t_create_vertex_buffer.22_error

    Personally I think that baking a ton of highpoly cars is not the best idea. In my game (where I have many cars, some up to 80k) what I do is:
    - Bake Skylight to vertices once for every car type. Or you can just bake regular texture lightmaps and put them to AO slot of the material.
    - Use Volumes for their lighting (light probes can be used too, but will give less precision).
    - Use a deferred "AO decal" underneath the car. You can also use a regular Unity "projector". Decals are baked in the same pass where I bake Skylight and they look like this:

    upload_2021-3-13_22-48-51.png

    In my case most cars can also move, so it's obvious I can't just bake them like static objects. However, I think it's also a valid approach in your case as well.

    End result:



    upload_2021-3-13_22-54-1.png

    Getting good reflections is super important for cars.

    Similar approach can be sometimes used for trees, when you also have a combination of huge object count and huge complexity of every object.

    Tried the latest version of UPR graphs?
    There is some weird API difference on different platforms and I'm not sure what triggers it exactly.
    You can see this branch in BakeryDecodeLightmap.hlsl:

    upload_2021-3-13_22-59-5.png


    Apparently on Metal, the API used by URP is different, I'm not sure about other platforms. Can you:
    - Try leaving only one of these and see which one works? (remove the other part, as well as #if, #else, #endif lines, save, then click Save Asset in the graph editor of any affected graph)
    - Tell me what graphics API you are using? (target platform?)

    Path length is infinite. GI bounces also have no limit... I just limited the slider. But you can, in fact, just type any higher value in the text box:

    upload_2021-3-13_23-7-57.png

    As atomicjoe said, it's just texture compression (or denoising. or both). These advices (about bright edges) may help you: https://geom.io/bakery/wiki/index.p...oduces_bright_edges_around_geometry.2Fshadows

    The noise is quite huge! Maybe you should also try increasing the resolution.

    Can you show your lightmaps?
     
    Last edited: Mar 13, 2021
  50. Brackaterts1

    Brackaterts1

    Joined:
    Jan 13, 2018
    Posts:
    8
    I've been using Bakery for a few years and ran into some compiler problem after being away for a few months. I opened a new unity install (2018.4.21f1) and a new project and installed bakery and had the same issue. Not sure if this is a problem with the specific version I'm on or it's on my end. I ended up using an old bakery version from 2019 and it works, but when installing from the asset store it doesn't work. Unable to use the bakery window because it disappears. Also if I install the real time preview on top of the 2019 version it creates the same problem and is not usable.
     

    Attached Files: