Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

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

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

  1. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    Can help, yeah https://geom.io/bakery/wiki/index.p...oduces_scattered_bright_spots_.28fireflies.29

    Still a hacky solution IMHO. Disabling the shadow would unnaturally brighten the floor and all occluded table/chair faces. Your scene seems to be more or less realistic-looking, so I'd think in terms of real-world lighting approaches.
    For example, you can just increase light size. Larger the light -> faster the shadow will get blurrier.

    Uhmm? CUDA is NV-specific.

    Perhaps you can split your scene into sectors and bake them one by one? https://geom.io/bakery/wiki/index.php?title=Partial_scene_baking

    - It seems like OptiX6 does the best denoising job with these textures. Make sure it works with standard shaders, then the problem is only limited to your shader.
    - On your screenshots it looks like your alpha meta pass outputs scaled UVs? Perhaps the noise is too large? Try tiling it more. Additionally, try increasing this value:

    upload_2021-6-26_20-21-19.png

    It can also be possible that your noisy objects take very little UV space, even at maximum lightmap resolution, in which case try increasing their Scale In Lightmap.

    Are you sure? Can you drop me an FBX? Will check it.

    Hmm. Can you try setting GI VRAM optimization to Force OFF? https://geom.io/bakery/wiki/index.php?title=Manual#GI_VRAM_optimization

    Also 300 lightmaps sounds simply a bit too much. Perhaps you can split the scene into multiple sectors and bake them separately?

    Yeah just got the latest Better Lit and it doesn't seem to work with Bakery options (in URP as well). Will check it with Jason.
     
    sjm-tech and keeponshading like this.
  2. jornade

    jornade

    Joined:
    Mar 25, 2021
    Posts:
    1
    Hello,

    My current GPU is a 5700XT but i still have my old 1050ti laying around, would it be possible to install it alongside my current GPU (i have the extra PCI-E slot required) and use it for Bakery only?

    Thanks for your time.
     
  3. elok11

    elok11

    Joined:
    Dec 9, 2019
    Posts:
    9
    Hello, please find here the FBX file:

    https://drive.google.com/file/d/1D94crApqM_or1a_2Pdp5GexiZsnywLXv/view?usp=sharing

    Thank you
     
    guycalledfrank likes this.
  4. Sisay

    Sisay

    Joined:
    Dec 6, 2012
    Posts:
    28
  5. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    61
    Hey, I am getting new error - "can't create texture", after I press ok, it brings "Failed to present D3D11 swapchain due to device reset/removed."

    My PC specs and space are plenty for baking: 2TB M2, 64 GB Ram + 60 gb virtual memory, 1070Ti 8gb.

    I think it started happening after I swapped my hard drive and migrated my whole system to it. I can bake smaller parts of this project/map, but when I try the whole thing, I get this error. I reinstalled graphic drivers just in case, so it shouldn't be a problem.
     

    Attached Files:

  6. Jade_Curtiss

    Jade_Curtiss

    Joined:
    Jul 20, 2013
    Posts:
    20
    Thanks for help, frank!
    Now I have some lightmap optimization issues here. I want to limit the lightmap count to a small number, let's say just 1 lightmap here, so I place a Lightmap Group Script to the root node of all static objects. Unfortunately this lead to lightmap overlapping, also the LOD objects of the root node groups in another one.
    As far as I know, if properly set, Bakery would help to pack all children object into one atlas without overlapping.
    I'm using Bakery v1.9.
    My Lightmap Group setting is shown as below:
    upload_2021-6-30_16-56-32.png
    Bakery Settings:
    upload_2021-6-30_17-0-52.png
    And there is absolutely overlapping in detail
    upload_2021-7-1_14-21-29.png
    Is there a problem that when too much objects are placed under a parent node with Lightmap Group Selector, they can't be pack into a single lightmap?
     
    Last edited: Jul 1, 2021
  7. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    Do you have an idea how complicated it is to fix the Directional SH and Volume integration in the BetterLit?
    I could auto rebake my scene to the the next visual level then.)

    Unity 2020.3.x LTS with HDRP 10.5.0
     
    Last edited: Jul 1, 2021
  8. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    61
    Never mind, I solved this by baking every model separately until it crashed again - then I knew which model was causing the issue.

     
  9. Luvrael

    Luvrael

    Joined:
    Sep 9, 2017
    Posts:
    19
    My scene after baking in 4k has 14 lightmaps, the last 3 of which are packed very little.

    If I understand correctly, xatlas and hole filling are used to package lightmap more efficiently. However, after baking, this message appears to me.
    upload_2021-7-1_12-46-52.png

    When, according to the message, I use the "detect optimal settings" option, this message appears again after re-baking. What can I do to better pack these lightmaps?

    My bake settings:
    upload_2021-7-1_13-10-44.png
     

    Attached Files:

  10. tootyboi

    tootyboi

    Joined:
    May 9, 2019
    Posts:
    7
    Hi Frank,

    I am getting this weird error when I am testing out Bakery with the Meadows Scene demo by NatureManufacturer. It says:

    "bakery can't read lightmap for GI..."

    This is weird, because when I dig deeper into the .ftracelog file, I noticed that I had the following error:

    "
    ...
    Loading additional lightmap: Meadow Demo Bakery Test_LMA54_diffuse_HDR.lz4
    LM is half
    Loading additional lightmap: Meadow Demo Bakery Test_LMA119_diffuse_HDR.lz4
    LM is half
    Loading additional lightmap: Meadow Demo Bakery Test_LMA283_diffuse_HDR.lz4
    LM is half
    Loading additional lightmap:
    LM is half
    Loading additional lightmap: Meadow Demo Bakery Test_LMA148_diffuse_HDR_LOD8.lz4
    Can't read lightmap for GI: Meadow Demo Bakery Test_LMA148_diffuse_HDR_LOD8.lz4
    "

    This implies that the lightmap produced by Bakery can't be read by the software for some reason. I have uploaded my params. Looking forward to hearing from you, thanks.
     

    Attached Files:

  11. tootyboi

    tootyboi

    Joined:
    May 9, 2019
    Posts:
    7
    It turns out that re-importing the asset helps with this issue for some strange reason. Bakery works very well!
     
    guycalledfrank likes this.
  12. artsymarie

    artsymarie

    Joined:
    Apr 26, 2020
    Posts:
    1
    Lovely add on! Thanks for all your hard work.

    I’m running into an issue where static objects randomly won’t show up in preview and even after baking receive no light. Even though some of them did bake before. All objects use the same standard shader. I import my fbx files and they have generated UVs. I do reimport often from Blender.

    Could you assist?
     
    guycalledfrank likes this.
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    OK, Better Lit integration was fixed, should be updated soon.

    Should work. It should automatically detect any CUDA-compatible GPUs. If you'll have any problems with it, DM me.

    Thanks. Even without baking I can see the normals are not great:

    upload_2021-7-4_15-22-37.png

    upload_2021-7-4_15-22-41.png

    If you're using a normal map, consider
    a) Using "Baked normal maps" mode.
    b) Using hard edges on >= 90 degree angles before baking it.

    This is texture compression. Try:
    a) Disabling texture compression on lightmap assets (set to None; no need to rebake).
    b) Possibly using Backface GI = 1, as it passes more light into dark interior areas, resulting in more compression-friendly maps.
    c) Just baking in higher resolution.

    Given you have so much RAM/VRAM, it's probably not going out of memory. But what could happen is
    - Some object has wild broken UVs where many triangles go over the whole 4096 map.
    - Rasterizing these UVs probably takes more time than allowed by the TDR limit
    - Driver is reset. "Can't create texture" is just a consequence then.

    Check if there are no complex objects with broken/non-generated UVs? I highly recommend using my UV debugging shader: https://geom.io/bakery/wiki/index.php?title=Community_extensions#UV_Debug_Shader

    Can you show me what .ftracelog.txt show to you right after this error?
    Are these checkboxes enabled?

    upload_2021-7-4_15-50-23.png


    xatlas is also limited to produce all maps of the same size.
    My older packer can generate differently sized maps. On your screenshots it looks simply as if there were some leftover charts it couldn't fit, but it still has to allocate a full-sized lightmap.
    You can try it with my original atlas packer, it doesn't have the hole filling option, but perhaps can be better in your case.

    Weird! Reimporting Bakery or Meadow?

    They definitely can't do it randomly. But make sure that your objects:
    - Have "Contribute GI" enabled ("Lightmapped static" in older versions).
    - Don't have the "EditorOnly" tag.
    - "Scale In Lightmap" is not 0 (will still show in preview and affect other objects though; but won't receive lightmap on its own).
    - Object is MeshRenderer or SkinnedMeshRenderer, both component and gameobject are enabled.
     
    sjm-tech likes this.
  14. Jade_Curtiss

    Jade_Curtiss

    Joined:
    Jul 20, 2013
    Posts:
    20
    I don't know if it is a bug or something...
    I have done a lot of test afterwards. I have s scene with two part of objects and let's name it GroupA and GroupB. There are some cases that generated lightmaps don't have ovelapping.
    1.When I add a Plane object to the scene, GroupA with Lightmap Group A, GroupB without Lightmap Group attached, and rebake. The plane and GroupB have their own lightmap, also GroupA have its lightmap and everything is fine without overlapping.
    2.GroupA with Lightmap Group A, GroupB with lightmap Group B, and rebake. The GroupA and GroupB have their own lightmap without overlapping.
    The problem is, when I don't have the procedure above, which in the case GroupA with Lightmap GroupA, GroupB wihout Lightmap Group and no plane object, rebake. GroupA have its lightmap but some objects in GroupB have its lightmap pixel in GroupA's lightmap and cause the overlapping.

    Edit in 7.6
    Another test:
    I disable all lodgroup and everything works fine.
    I think I found the problem, I have my lodgroup that only lod0 should bake GI and the other lod levels don't, so I set their StaticEditorFlags with (~StaticEditorFlags.ContributeGI). Maybe it it the point cause atlas calculation error.

    Look forward to your reply!
     
    Last edited: Jul 6, 2021
    guycalledfrank likes this.
  15. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    61
    I actually managed to get out of 64 + 60 (virtual) gb ram... I think it might be some of the baking settings that I changed are causing this. It would be nice to have baking pre-sets, rather than only "Load default settings" option, as that can be overwritten by "Save as default"?
    I will delete Bakery and Re-import to hopefully get back the default settings.

    Update: reimporting Bakery does not reset settings. Where is settings file located? Or how should I get true default baking settings?
     

    Attached Files:

  16. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    Checked the actual BetterLit Bakery integration (1.2.5) and there are still these issues like described before:

    Unity 2021.3.x LTS, HDRP 10.5.1

    Middle wagon: BetterLit (wrong shading, to dark)
    Other wagon: Bakery Volume Graph (correct shading)

    BL_Volume.JPG

    Bakery SH directional:

    Better Lit SH (down plane, flat shading)
    vs
    SpecGraphSH (upper plane, nice directional SH)


    BL_SH.JPG


    SH Demo II

    left: SpecSHGraph
    right: Better Lit SH

    sh.JPG


    RNM Demo

    TOP: BakeryRNMGraph, -> OK
    Bottom: Better Lit RNM setup -> strange

    RNM.JPG


    complete Directionals overview
    first row - Bakery Standard Graphs and HDRP Lit
    second row -> BakeryLit

    green -> ok
    red -> broken

    Directionals_BetterLit.JPG
     
    Last edited: Jul 7, 2021
    guycalledfrank and sjm-tech like this.
  17. AHFontaine

    AHFontaine

    Joined:
    Aug 3, 2017
    Posts:
    18
    Hi, I don't seem to understand what I'm doing wrong.
    I'm making a scene with doors that open through an animation, so I experimented with Volumes.
    I followed the same setup as the one on the examples of v1.9 and made different materials for my non-static doors. I would still get a result where the material is completely lighter than the rest of the scene. (Material are set to the volume)


    I'm not entirely sure what I'm doing wrong here. Any cues as to why I would get this issue?

    (Unity 2020.3.11, built-in)
     
  18. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    BetterLit Bakery integration, Shadowmask issue (1.2.5):

    Unity 2021.3.x LTS, HDRP 10.5.1
    latest Bakery patched

    Shadowmask L1 probes, HDRP Standard -> ok

    ShadowMask_L1_probes.JPG


    BetterLit Shadowmask L1 probes -> dynamic capsules are broken, see bright illumination on right side
    ShadowMask_BetterLit.JPG

    I could upload the Bakery vs Better Lit HDRP project with all the test scenes if it helps.
    (Edit: uploaded to link you got per PM)

    scenes.JPG

    Sorry for poking. When Bakery and BetterLit run together we can reach another leavel easily.
     
    Last edited: Jul 8, 2021
    guycalledfrank and sjm-tech like this.
  19. Zoidberg656

    Zoidberg656

    Joined:
    Sep 26, 2018
    Posts:
    11
    I just updated my Bakery, but I can't bake because it tells me to "add one lmgroup", and I have no clue what that even is or does.
    Also, what is a "Bakery Sector"?
     
  20. Jodelahithit

    Jodelahithit

    Joined:
    Sep 11, 2018
    Posts:
    2
    Hey guys, I recently got Bakery as it offers some nice features and, according to reviews, looks better than the standard lightmapper. However, I've been experimenting with it for the past few days and I've found that the results aren't really what I expected. For example, even though I'm using a 3090, the standard Unity lightmapper is significantly faster and shadows look much smoother. There are also strangely colored artifacts everywhere, especially when objects are partly placed inside other objects. Here's a low pixels-per-unit bake of Bakery:


    versus a Unity bake with the same amount of pixels-per-unit:


    Here's also a screenshots of what the strangely colored pixels look like in a lightmap:


    The settings I used (with different pixels-per-unit) can be found here: https://gyazo.com/9d0ed61d8306d0f3949808e33217cd45

    No matter what Bakery settings I change, I always seem to be getting these weird colors that completely ruin the visuals of the world. Is this a common issue? And if so, how can I fix it?

    Thanks in advance!
     
  21. JBAMat

    JBAMat

    Joined:
    Jul 9, 2021
    Posts:
    1
    Hey ya!

    We tried networking baking which worked for a different scene. But for some reason the one we are currently doing spits out this error "server: ftraceRTX error: Unknown error (-1073740791)". I tried looking up the error code and it came back with someone unrelated so I'm not totally sure if this is related to Bakery.

    I thought maybe the error is that the client doesn't have a RTX card but the server does. If we uncheck RTX on the client we get a different error but also ftrace.

    Thanks!
     
  22. Zoidberg656

    Zoidberg656

    Joined:
    Sep 26, 2018
    Posts:
    11

    Lowering the emission strength from 2 to 0.6 on streetlamp bulbs in an alley way reduced firefly artifacts for my scene.

    Keep in mind that these streetlamps are nowhere near this wall. And I did no edits to the actual long black lamp attached to the wall in these shots.
    Screenshot 2021-06-16 093034.jpg nomoreflies.PNG
     
  23. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    27
    I've been baking light probes with the 'Legacy' option because I wanted the increased resolution of L2 spherical harmonics over just the Bakery L1 harmonics, however recently I've found that the Legacy probes differ quite a lot from the lightmap (usually the Legacy probes are about 50% darker) so I've had to switch to L1.

    The docs hint at a Bakery L2 option being in the works - is that still a thing? Is there an approximate ETA? Alternatively is there something I can do to get Legacy probes to better match the lightmaps?
     
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    OK, it wasn't. Or, well, it was, and I sent the fix, but apparently current BetterLit releases are still not working :(

    I hope it'll be working soon.

    Should work. If there are LODs, make sure to use xatlas and post-packing. Your screenshots show the correct setup, so it's weird there are overlaps! Any chance you can send me some unitypackage for debugging?

    So non-lightmapped (Contribute GI disabled) objects affect the overlapping? Not sure I can understand how to reproduce it.

    On your screenshot it's going out of VRAM, not system RAM.

    Just lightmap count/resolution in this case.

    I agree. I should add them eventually. Also, a little known fact: you can use Lightmapped Prefabs to store/load render settings.

    Yeah. Default settings are in ftGlobalStorage.asset. You can delete the file, and it'll be regenerated using original defaults.

    Maybe volume isn't positioned properly or it's too low-res, so some exterior objects light the door? Given there are no shadows from surrounding objects, it feels like it. Or maybe the volume is not marked global and the door doesn't have a script to receive it (like the one on the train in my example scene)? If you can send me any scene to debug, I'll check it.

    Hmm, weird. It means there are no bakeable (marked as static) objects in the scene. However, it usually prints a more descriptive message before reaching this point. Do you have "export geometry and maps" checkbox enabled? Do you click "Render"? (i.e. this is not with selected/probes/etc?)

    https://geom.io/bakery/wiki/index.php?title=Partial_scene_baking

    Did you enable RTX mode?
    Is your lightmap resolution comparable between Bakery/Unity? (same texels per unit doesn't mean identical atlases).

    For smoother shadows usually just tweak Shadow Spread: https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_jagged_shadows

    Check if your lightmap assets have any texture compression enabled on them, as colored artifacts usually come from compression. If your Unity lightmap assets are non-compressed, and Bakery lightmap assets are compressed, it would explain it.

    upload_2021-7-11_23-31-54.png

    Yeah, it's not a real error code, seems like a hard crash. Does the same scene bake on the local machine? I can debug it for you, just
    - Clear ftServer folder on the server machine (default path is C:\Users\You\AppData\Local\Temp\ftServer)
    - Bake on the server
    - If it fails, send ftServer folder to me.
    It should contain enough data to reproduce any issues.
    Also make sure that the server machine doesn't simply have e.g. AV software that kills ftraceRTX because it just doesn't like any new exes (like avast sometimes does). Most hard crash cases I heard of were related to some 3rd party software killing the process. But it can be a bug too.

    I highly recommend using Light Meshes instead of emission for any meaningful light sources, as they have better sampling strategy that avoids it.
    https://geom.io/bakery/wiki/index.p...ces_between_Light_Mesh_and_emissive_materials
     
  25. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    Shouldn't give such a huge difference, are you sure? Seems OK in the example scenes. However, given Legacy probes simply capture the scene via in-engine rendering (except for directs/points), there is a range of possible issues, e.g. your renderable skybox brightness (visible by camera and legacy probes) can differ from the Skylight settings (visible by lightmaps). In fact, it's the most likely case. Do your skybox/skylight match? There is an easy way to match Skylight to any procedural skybox shader: https://geom.io/bakery/wiki/index.p..._use_Skylight_with_a_procedural_sky_shader.3F
     
  26. V-Rangers-Support

    V-Rangers-Support

    Joined:
    Feb 6, 2018
    Posts:
    3
    Hello,

    I have an issue with shadows artefacts since a few weeks :
    capture_2.JPG

    Those artefacts appear on Unity 2019.43f1, Unity 2020.3.5f1 and Unity 2021.1.4f1 with Bakery version 1.9.

    For my tests I created an empty scene, import my 3D models, set them as static objetcs, set a bakery direct light and bake.

    capture_1.JPG

    Here are the import settings of the 3D models :
    capture_3.JPG

    These problem also appear on other 3D models I've made. This is a huge problem because I love to use Bakery for lightmapping but I have a delivery for the end of July and I can't use the plugin if all my environment is full of artefacts.

    Here is a Unity Package with the 3D rock model that shows artefacts.

    If you have more information on how to solve this problem, please reply as soon as possible.

    Best regards.
     

    Attached Files:

    guycalledfrank likes this.
  27. Jade_Curtiss

    Jade_Curtiss

    Joined:
    Jul 20, 2013
    Posts:
    20
    For your convinience.
    And I have start an conversation with you to explain further.:)
     

    Attached Files:

    guycalledfrank likes this.
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    Interesting one. Can you try updating through the patcher? Or just try replacing the attached file.

    Thanks! Will continue in DM.
     

    Attached Files:

  29. Orangy-Tang

    Orangy-Tang

    Joined:
    Jul 24, 2013
    Posts:
    27
    There is no skybox visible from these scenes (entirely enclosed rooms) so I don't think it's that.

    I do have a completely custom shader with a stylized PBR lighting scheme (which has non-standard metallic/roughness handling), so maybe something there is throwing things off? The shader does have a META pass defined to output the albedo/emissive/roughness to the lightmapper, but it's not clear to me why the probes would be so much darker.
     
  30. AHFontaine

    AHFontaine

    Joined:
    Aug 3, 2017
    Posts:
    18
    Ok so just checked out the example scene again and, yeah, should have said that I did put the Volume Receiver on the doors.
    Right now, it's only a skylight with a real-time directional light and nothing else. But I would have expected the doors to have a somewhat similar tint than the walls.

    As for the resolution, I think that might be the issue. However, the Texel Per Unit count is pretty high in this scene due to the fact that it's not for game uses. (50)
    Putting the values for the volume to match that results in getting a :
    "OutOfMemoryException: Out of memory
    ftBuildGraphics+<CreateVolumeLMGroup>d__187.MoveNext ()"

    (I'm using a 3090 so a OutOfMemory exception is a tad odd)

    I suppose reducing the Texel Count of both the project + the volume would help? Even then, the VRAM estimate is 2gb when I have access to 24 so that's an odd one...
     
  31. V-Rangers-Support

    V-Rangers-Support

    Joined:
    Feb 6, 2018
    Posts:
    3
    Hello, I replace the file in my Unity Project and there is an improvement !
    capture_4.JPG

    capture_7.JPG

    The large artefacts have disappeared. However I still have strange little artefacts :

    View attachment 888814
    capture_6.JPG

    Thanks for your time by the way !

    I tried to use your fixe in my production project, but I still have big artefacts on some objects :

    capture_8.JPG

    I have a theory, I think it is when the sun's rays are aligned (parallel) to the surface of the object that the artefacts appear :

    Bakery Issue.png
    Any ideas ?
     
    Last edited: Jul 13, 2021
    guycalledfrank and JoRangers like this.
  32. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,225
    Hey @guycalledfrank , is there any technical reason why Bakery's maximum lightmap texture size is limited to 4096?
    I would want to bake to a very large texture size and then downsize it on a per "build target" basis.
    Like, rendering to 16k x 16k and then using 2k x 2k on Android and give the option to the user to choose between 4k, 8k and 16k on PC. (I would manage that myself, of course)
    My game is VERY lightmap dependent, so I would like to have the option to use very high quality lightmaps, since Bakery can deliver and PCs can handle 8k maps with ease.
     
  33. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    --------------------
    Hey there, sorry for reposting this old answer. But after trying out Bakery Lightmapped Prefab for serveral days now, I found the solution via Google in this thread.
    Maybe you can update the Bakery Lightmapped Prefab section in the Bakery Manual. For me it was hard to find out how the whole Bakery Lightmapped Prefab thing works, even with the sample scenes.
    The "apply all" button under the "overwrite button" was the solution for me.
    Anyway, thanks for the great plugin. Cheers
     
    guycalledfrank likes this.
  34. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    Hi,

    hopefully one last question about the whole Lightmapped Prefab topic. ;)

    Now I want to bring my baked test model to my main scene. Everything looks fine, see the picture below.

    Untitled-4.jpg

    The Prefab Lightmap looks like this:

    Untitled-6.jpg

    The problem is now, when I do a new lightmap bake for the whole scene, it will delete the lightmap of the teapot. And it looks like this:

    Untitled-5.jpg

    How can I preserve the lightmap of the teapot in my new scene? I unchecked "Static" and "Enable Baking", so it now should be excluded from further lightmap baking, but it does not work.

    Thanks in advance.

    edit: A workaround is to completely disable the Teapot Prefab in the scene, and turn on after the new bake. Maybe this is the right way to do solve this "issue".

    edit 2: The workaround only works, when the Prefabs baked in a different scene, just dublicate the scene you want to use and bake all desired prefabs in the dublicated scene.
     
    Last edited: Jul 15, 2021
    guycalledfrank likes this.
  35. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798


    Yay. Happy here.
    Latest Better Lit 1.26 fixes directional SH annd RNM bakes with Lightmap specular on HDRP.
    For me this is the most useful upgrade for HDRP at all.

    Thanks a lot to jbooth and Arthur.

    SH_yay.JPG


    left: SpecSH Graph
    right: BetterLit SH

    2.JPG


    Open issues.

    Better Lit Volume Shadowmask has still some issues.
    middle wagon : Better Lit Volume
    other wagons: Bakery Volume Graph

    Volumes.JPG

    volume2.JPG

    also some BetterLit Shadowmask issues on the dynamic capsules.
    See bright illumination on the right sides of the capsules.

    Shadowmask.JPG
     
    Last edited: Jul 15, 2021
  36. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,225
    @guycalledfrank also, now that we have a cool preferences tab on the project settings window for Bakery, it would be great if you could put an irradiance convolution L2 multiplier in there for the legacy light probes generation. This way we wouldn't need to change the "ftAdditionalConfig.cs" every time there is an update:
    Code (CSharp):
    1.     // Shader eval coeff * gaussian convolution coeff
    2.     // ... replaced with more typical convolution coeffs
    3.     // Used for legacy light probes
    4.     public const float irradianceConvolutionL0 =       0.2820947917f;
    5.     public const float irradianceConvolutionL1 =       0.32573500793527993f;//0.4886025119f * 0.7346029443286334f;
    6.     public const float irradianceConvolutionL2_4_5_7 = 0.2731371076480198f * 0.6f;//0.29121293321402086f * 1.0925484306f;
    7.     public const float irradianceConvolutionL2_6 =     0.07884789131313001f * 0.6f;//0.29121293321402086f * 0.3153915652f;
    8.     public const float irradianceConvolutionL2_8 =     0.1365685538240099f * 0.6f;//0.29121293321402086f * 0.5462742153f;
    9.  
    (multiplying the L2 irradiance convolution coeff by 0.6 fixes the lightprobe ringing effect and it's very much needed when using lightprobes for full baked lighting, not only indirect.)
    (Full lighting bake in lightprobes is the reason I still use Legacy light probe generation by the way. L1 lightprobes just doesn't cut it for that.)
     
    guycalledfrank likes this.
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,466
    I don't think there is any meaningful way to fix it completely for this geometry, as it's simply too low-poly, with smoothed normals being too far away from the actual triangle shape. All ray-tracing techniques will cast shadows from real (flat) triangles. Bakery has a special fix that tries to respect smoothed normals and push away the shadowing ray's origin, but I guess for this mesh it doesn't suffice.

    The fix is toggleable in Project Settings:

    upload_2021-7-15_12-2-2.png

    For comparison:

    upload_2021-7-15_12-3-15.png

    You can see Progressive gives similar results to Bakery when "Generate smooth positions" is disabled, although it also blurs some artifacts somewhat. Generally I recommend keeping the fix enabled and possibly use geometry where normals better correspond to the shape. In your case maybe you can just turn it off, at least it won't differ much from Progressive.
    If you use normal maps on these meshes, bake in "Baked Normal Maps" mode.

    You can read about my "smooth position" mechanism here: https://ndotl.wordpress.com/#shadowterm

    If you use Light Meshes, there can be a similar case with them, i.e. visible emissive color must match the lighting color/intensity.

    Possibly. Legacy light probes don't use the meta pass; they just see things directly as the camera. L1/volumes don't have these limitations.

    I'm talking about voxels per unit (on the volume) though. 50 is definitely way to high for the most cases... that would be like 50*50*50 = 125000 voxels in one unit, similar to a 354x354 texture per unit.

    This one's is C#'s OutOfMemory, i.e. it got out of system RAM trying to allocate an array of that many voxels.

    In you case even 2 voxels per unit should work well for the door. It looks like receiver is not picking up the volume maybe? Or it's not properly positioned? The example BakeryVolumeReceiver also doesn't execute in Editor, only in play mode...

    You can set it to 8192 in lightmap groups. You can also just remove the limit in the main window UI and set it there too. It's an easy way to go out of memory though. Not sure about 16k, I didn't test it.

    That might be not so great idea. See my "mip-mapping lightmaps" section: https://ndotl.wordpress.com/#mipmapping
    You can end up with the "naive downsample" result.
    Basically it'll only work if your UV charts are spaced far enough from each other to take at least a few texels in the lowest resolution lightmap.
    You can kinda try to achieve it with this:

    upload_2021-7-15_12-22-25.png

    This will still generate a high-resolution lightmap, but with UV padding optimized for 1/8 size.
    It will also just reduce lightmap's Max Size after the bake:

    upload_2021-7-15_12-23-20.png

    OK, updated the docs :)
    https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmapped_Prefab

    Hmm... does simply reloading the scene work? I can see in-prefab storages are not executed after scene rebake (will fix), but (re)opening the scene or playing it gets the prefab lightmaps back.

    Yey!

    Yeah. We're not sure yet to hook into the shadowmask in HDRP, but it will work.

    Yeah it seems to be a general BetterLit problem (using tangent normal instead of world for looking up probes in HDRP?).

    I wasn't sure it's widely used... but OK, will add it there.
     
    Last edited: Jul 15, 2021
  38. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,225
    Man, I have to find ways to justify my 3090's 24GB of VRAM, so that's ok. :D
    I counted on that, yes. I actually already do it but with 4k for PC and 2k for Android lightmaps.
    Yay! Thanks Frank! you're the best! :)
     
    guycalledfrank likes this.
  39. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    Thank you for updating the manual.

    And yes, you are right. Playing the scene brings back the prefab lightmaps. :)

    Thank you for all the work you are putting in the plugin.
     
    guycalledfrank likes this.
  40. wlchfl5358

    wlchfl5358

    Joined:
    Aug 18, 2020
    Posts:
    2
    Hi, I tried to Bake lightmap and some objects look very bad :(
    All objects are checked on 'Generate Lightmpa UVs' and i'm using URP.
    Everytime i try to bake, some results are bad..
    What did i wrong??
    Thank you.

    캡처.JPG 캡처.JPG 캡처.JPG
    캡처.JPG
     
  41. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    Hi, try to use a higher number under "scale in lightmap", start with 10 or so, just for testing. If it looks ok now, lower the number, if you want.

    Unbenannt.PNG
     
  42. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    Hi there,

    is it possible, that after baking with Bakery volume effects like density volume and fog disappear?

    before baking:
    1.PNG

    after baking:
    2.PNG

    How I can achieve light shafts when using Bakery? Thanks
     
  43. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,225
    Volumetric effects like sunshafts from volumetric fog only work with realtime shadows.
    Baking in "Full Lighting" mode will disable realtime shadows on lightmapped geometry.
    Bake your lightmaps using "Indirect Only" or "Shadowmask" mode to keep realtime shadows instead.
     
    guycalledfrank likes this.
  44. StoneHill1337

    StoneHill1337

    Joined:
    Nov 4, 2020
    Posts:
    17
    Thanks for the answer. Is there a way to fake such light shafts, via geometry+shader?
     
  45. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    temporal quickfixing.
    Or a tanline?
    Shadowmask_quick_probe_fix.JPG
     
    Last edited: Jul 16, 2021
    guycalledfrank likes this.
  46. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,225
    guycalledfrank likes this.
  47. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    Nothing big.
    After Vertex bake with the BetterLit, project opening and scene load the bake is complete black.

    Unity 2020.3.13f1,
    HDRP 10.5.2,
    latest Bakery github,
    latest Better Lit 1.2.7

    BetterLit_exampleLights.JPG

    Needs play mode to make the vertex visible.
    There is also a bright area on the side of the sphere. Not completly sure if this is right?

    All Better Lit converted scene.

    2.JPG


    HDRP Lit scene has no bright spot.

    3t.JPG
     
    Last edited: Jul 20, 2021
  48. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    Hi.


    Unity 2020.3.13f1,
    HDRP 10.5.2,
    latest Bakery github,
    latest Better Lit 1.2.7


    I did a new repro. (link per PM). It has all the working BetterLit HDRP scenes dicsussed before and additional these:

    Shadowmask scenarios.

    _PLM -> PLM bake
    _PLM_BetterLit -> PLM bake with BetterLit

    _Bakery_L1 -> Bakery L1 bake
    _Baker_L1_BetterLit -> Bakery L1 bake BetterLit

    _Bakery -> Bakery bake
    _Baker_BetterLit -> Bakery bake BetterLit

    Unbenannt.JPG


    you can fast toogle between the scenes to see the issuses.


    1)

    PLM bake (1.Screenshot) vs Bakery L1 bake (2. Screenshot)

    plm.JPG

    bakery L1.JPG

    same result -> great
    Question: Why are the L1 probes so dark close to the wall compared to the L2 probes from PLM?)




    2) PLM bake with BetterLit (1.Screenshot) vs Bakery L1 bake BetterLit (2.Screenshot)

    3.JPG



    4.JPG


    Same tanline on moving capsules on booth scenes. PLM and BakeryL1 with BetterLit´s.
    Seems this is an general shadowmask BetterLit problem.

    Probably you can explain this behaviour and problem better to Jason like i can?
     
    Last edited: Jul 20, 2021
    guycalledfrank likes this.
  49. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    3) Bakery L1 probes vs Bakery Legacy probes

    bakery L1.JPG


    5.JPG

    The Bakery Legacy probes bake (Screenshot 2) are much brighter than the Bakery L1 probes bake. (Screenshot 1)
    Is it possible to get the same result?

    First i bake Bakery (Light Probe Legacy) and the i hit Render Probes probes.
    Probably i do something wrong here.
     
    Last edited: Jul 20, 2021
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    798
    Has anyone a idea how to resolve this shadowmask issue with the 5th light?


    Unbenannt.JPG

    4 overlaping lights should share one group id, eg. 0? -> the are rendered in one shadowmask
    the 5th light i set to group id 1? -> this is rendered in an second shadowmask

    Think i don t understand the overlaping logic.

    Is there a way to visualize the overlaping from shadowmasked lights?
     
    Last edited: Jul 23, 2021
unityunity