Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

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

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

  1. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    Do you think you could port this to the native Bakery shaders for BIRP as well? Perhaps it could even somehow work on deferred? Because I'm really struggling right now to combine baked specular with reflection probes. I don't even mind this only working on rougher materials, and all the other drawbacks, the big problem is that dynamic objects can't pick it up (unless there is some way to get specular from volumes maybe?) and very glossy objects also need reflection probes - but reflection probes then always just get added TO the baked specular, creating the issues you described above. I can't disable reflection probes only for some objects either, since deferred can't really do that. Do you think there is some way to make this work? It's really a huge issue right now and makes using baked specular in deferred near impossible, which is a shame because it's incredibly promising tech especially for "hybrid scenes" (where some lights are entirely realtime, and static ones have their indirect lighting and specularity baked).
     
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    What light type are you using, is it Cone projection? Also how does it look without the denoiser and how many shadow samples do you have on the light?
     
  3. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Yeah, it's not hard to add - noted, will try.
     
  4. RPGia

    RPGia

    Joined:
    Jan 23, 2017
    Posts:
    44
    Hello, is it possible to use Bakery Volumes with surface shaders? Do you happen to have an example of this? I use surface shaders for custom texture channel packing, but I want to use Bakery Volumes as well.
     
  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Soo I'm preparing the new store version...

    upload_2024-1-10_15-13-39.png


    Seems like the new update will appear as requiring Unity 2019.4 minimum on the store (even though it works on older versions). But on older you will still be able to download... previous version. Which I cannot patch, because Asset Store Tools don't even work on 2018.4 anymore.
    So hopefully that's OK?

    It is possible, I think someone asked me about it before. and I wrote an example (see attached).
     

    Attached Files:

  6. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    Brilliant! This would solve a HUGE issue with baked specularity.

    Also, just as a note - I've showed some other people the version of the Bakery shaders with a Roughness map, and there was some interest from other folks as well in using it; maybe it's worth considering including it by default?
     
  7. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    84
    Hi!, is there any plans to support Adaptive Probe Volume? I was testing it on 2023.3 and look really cool.
     
    miinoy likes this.
  8. miinoy

    miinoy

    Joined:
    May 27, 2019
    Posts:
    16
    Wondering this as well. APV are great!
     
  9. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    143
    More likely is there any plans to improve baking APVs using Bakery? Since it's generate severe light leaks in enclosed environments and devs not gonna bother improving it further
     
  10. ItsPerona

    ItsPerona

    Joined:
    Dec 29, 2022
    Posts:
    1
    I would like to be able to have baked lighting and when interacting with a switch to be able to activate and deactivate that lighting. How can I do it?
     
  11. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @guycalledfrank

    I ran into another bug. I dm'ed you a test project. Hope it helps. :)
    upload_2024-1-18_21-14-47.png
     
    guycalledfrank likes this.
  12. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    This is a static baked desk, with drawers that pull out that are not static. The drawers use BakeryURPVolumeSpecGraph, and the desk - which is static - uses BakeryURPSHSpecGraph. I also have a BakeryVolume wrapping everything, and the scene has been baked with the BakeryVolume included, and the BakeryVolume is set as Global. The textures used are identical, and the material settings used are identical. BUT - the non-static pieces are WAY SHINY. Everything SHOULD look like the desk. Why is the volume spec making things so shiny? It seems almost like the VolumeSpecGraph is taking the reflection properties and throwing it full value instead of making adjustments... any advice on how to make these look the same?
     

    Attached Files:

  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    A bit delayed, because I still get some bug reports like

    (Just fixed, pls check the last patch)

    Want to make sure there is nothing breaking before the release.

    OK, added this little checkbox:

    upload_2024-1-20_15-51-19.png

    If you have it + Reflections enabled, lightmapped specular will attenuate reflections. Can you try the latest patch?

    OK... will try to integrate it next time. Respond to this post with something, so I get a notification here and don't forget it :D

    As far as I know, currently there is no public API (correct me if I'm wrong, but it was the case recently) to modify APV data, i.e. it's a black box. I don't know how they generate/store this data.
    I can only suggest using Bakery volumes instead for now: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Volume
    Apart from memory considerations due to non-adaptiveness, is there anything that APV can do and Bakery volumes can't?

    One of the reasons I implemented Volumes was exactly that they're NOT a black box. I already have a PTSD from working with Light Probes / Lighting Data Assets and I would never use them in my projects personally. You don't need to steal my source code to see how Volumes work. Volumes are just 3D textures with a simple mapping that can be read, re-written, re-encoded, scripted, changed any way you want. Things like moving Volumes together with e.g. elevators is trivially scripted, because it's not a black-box dark magic system.
    APVs have unknown proprietary data format, unknown adaptive placement logic, etc. Of course all of this is going to also randomly change from version to version.

    Since it's being asked too often, I've just added my answer to the docs: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_switch_lightmaps_at_runtime.3F

    What is the resolution of the volume in comparison to drawer size? It feels like the voxels are too large and their centers are possible somewhere behind walls (in a brighter area)?
     
  14. miinoy

    miinoy

    Joined:
    May 27, 2019
    Posts:
    16


    As far as APV goes, they work REALLY well on dynamic non static meshes. For things like characters that require certain shaders and cannot use the SH from bakery. Light probes are a mess to work with.

    I guess i could could try editing the character shaders i use to support the Bakery SH for now especially since you mentioned APV are a black box atm. It seems like unity has hardly even talked about APV for whatever reason. The tech is there and imo would be a great version of "Lumen" that is more scalable...especially when they add the APV replacement for enlighten realtime GI this year.
     
  15. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    80
    Question: What is the most optimized/performant way to set up dynamic shadows in a scene with baked lighting?

    My target platform is Quest 2 and Quest 3 (mobile VR) and I need to add realtime shadows for dynamic objects, but need to keep things as optimized as possible due to mobile hardware. I'm aware that there are several ways to handle mixed lighting: 1) Indirect, 2) Shadowmask, 3) Distance Shadowmask, 4) Subtractive

    Is "subtractive" the most optimized way to do shadows alongside baked lighting? I understand that with subtractive the shadows are limited to a single angle/directional light, and a shadow color must be set. This works ok for some scenes, but maybe not for more complex scenes with indoor/outdoor areas.

    If "subtractive" is the most optimized way to do dynamic shadows, then what's the 2nd most optimized workflow for baked lighting + dynamic shadows that are a bit more realistic than subtractive mode?
     
    Last edited: Jan 20, 2024
  16. nyirdrone

    nyirdrone

    Joined:
    May 8, 2020
    Posts:
    3
    Hello
    This break in the lightmap, why is there? In several places. Thanks for the reply!
     

    Attached Files:

  17. RichieO

    RichieO

    Joined:
    Jan 31, 2014
    Posts:
    3
    Hey. I have 2 GPU's installed in my system, a GTX 1080 and Nvidia P40. I want to use the P40 for baking as it has way more VRAM. Is there any way to tell Bakery to use that specific card as it seems to be using my main GPU instead.
     
  18. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    143
    Unfortunately, I never tried BakeryVolumes just like regular Bakery as it gives pitch black scene after baking (Wasted more than 1 year of messing around with APVs) and the whole workflow is kinda messy when it comes with HDRP, clearly Bakery is intended for URP/Built-in (I wish I could just change lightmapper in lightmapper tab)

    APVs are replacement for legacy probes and great for large outdoor scenes, baking times in matters of minutes, per-pixel lighting for all objects, ability to save baking sets and blend between them (blending not presented yet, you can only switch, and probably will come with Dynamic APVs)
    Basically it removes all stupidity with normal baking; no seams on wall corners, no random dark patches and anything UV related.
    However, because this method is based on irradiance probes (not dynamic) light leaking is huuge problem and indoor walls should be at least three meters wide to completely hide all outdoor lighting.



    This is what APVs are based off, but stripped most of stuff to keep it cheap as possible.

    Still feeling guilty that never tried Bakery in HDRP properly, but not sure why pitch black thingy happens.
     
    xiangshushu and guycalledfrank like this.
  19. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    There you go, reminder to add the dedicated roughness map support to the main package and also add reflection probe attenuation by lightmap specular to it :)
     
    guycalledfrank likes this.
  20. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    Does Bakery devs know they can put the Editor folder inside of Bakery? And why not while you're at it, import it into a "Plugins" folder like most assets? :)

    Instead of having

    Assets/Editor/...
    Assets/Bakery/...


    At the root of the project, you'd have :

    Assets/Plugins/Bakery/...
    Assets/Plugins/Bakery/Editor/...
     
  21. UWSUMUT

    UWSUMUT

    Joined:
    Jul 14, 2020
    Posts:
    9
    Hello,
    I have a project in which I load a baked prefab as an addressable prefab and make it a child object of a gameobject on "DontDestroyOnLoad". It works ok and I can see the baked lightmaps on the MeshRenderer in the first scene. But, the baked objects inside the prefab lose their Baked Lightmaps at MeshRenderer component when I load another scene. This object is as I said, inside a DontDestroyOnload parent object so it always stays there when scenes load/unload. How to fix this?

    Unity Editor Version : 2022.3.12f1 LTS
    Bakery: 1.9501
    Rendering Pipeline: Built-in

    In the first scene:
    upload_2024-1-24_17-18-3.png

    After another scene loads:
    upload_2024-1-24_17-19-45.png

    @guycalledfrank
     
  22. Da_Drood

    Da_Drood

    Joined:
    Mar 30, 2021
    Posts:
    4
    Noob question: i'm reading the manual and it suggest to import Bakery_ShaderGraphURP.unitypackage for extra features, but when i click the import button i see the shader folder with the ticking window greyed out so i can't activate and import the shader folder. What am i doing wrong?

    Also i found out i can't commit a push in Github after installing Bakery, as it says file cudnn64_7.dll is over 100MB so, unless i use Git LFS (no thanks, had already a terrible experience with that and its small bandwith limit). I was wondering how other small teams like mine are dealing with this "issue" in order to be able to use the plugin while pushing commits to Github at the same time.

    I understand the .dll files it's only used by the Optix denoiser (which is the one that's been suggested by the plugin for my video card). Which other denoiser should i use, which doesn't involve .dll files bigger than 100 MB then?

    Also are there any comprehensive tutorials on youtube in which every feature is explained and a right worklfow is suggested? I feel overwhelmed with all those options and reading the manual without actually seeing the results makes it hard to understand how the plugin works and its potential.

    Sorry for all the questions in this long post and thanks for any answer i might receive
     
    Last edited: Jan 26, 2024
  23. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    guycalledfrank likes this.
  24. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    So I've been trying the new "Use Lightmap Specular as Reflection Occlusion" option in Bakery, however it doesn't seem to work using Deferred rendering. Is there any workaround/fix for this?

    This is the result in deferred:
    upload_2024-1-27_20-51-14.png

    This is in forward - Ignore the other bugged material here, just focus on the specularity on the ground:
    upload_2024-1-27_20-51-48.png

    As you can see, it works fine in Forward, but does not work in Deferred.
     
    guycalledfrank likes this.
  25. rc-alexf

    rc-alexf

    Joined:
    Mar 22, 2022
    Posts:
    2
    Sorry that I didn't answer. Thanks a lot for the script! That will be useful!

    If Unity was aware of that I don't know. Back then, maybe because they used LDR, the occlusion was usable and I used it. I never understood why they didn't make use of it.

    But after I posted this, I realized that, like you said, unity uses the alpha for the lightmap and throws away my alpha on android. It works on the editor, but not the build. For our use case (mobile VR with reasonable memory), we are using uncompressed so that would be great. And we don't use directionality or real time shadows. But I understand it's a very specific use.
     
    guycalledfrank likes this.
  26. YigitCetinkaya

    YigitCetinkaya

    Joined:
    Jan 4, 2021
    Posts:
    4
    Hello I am having problems with the substractive mode. Different results occur in the build-in and urp projects. In the urp project, different results also occur in the bakery and unity lighting.

    I am using Unity 2022.3.10f1 and I updated Bakery from github. When I encountered a problem in my own project, I tried to solve the problem by browsing the forum and the bakery manual. While browsing the forum, I saw the question asked by OttoCorrect on Jul 24, 2023 on page 134. It's a very similar situation. You said that he should open the occlusion probe, but OttoCorrect stated that there was no solution and repeated his question again on 29 joules. On page 135, you said that it worked normally in 2023.1.5 and that it was due to the way LightProbe was placed, and the issue is closed.

    When I open the occlusion probe and try to bake, the use proggresive option does not appear in the urp. I think the problem may be caused by this, but the build-in project works normally.
    1.png


    In the URP project, the sun passes through the static object and hits the dynamic object, but when I take the same bake from Unity, the problem goes away. Built-in project bakery bake.
    Uniq.png

    Urp project bakery bake.
    Uniq.png

    Urp Unity Bake.
    Uniq.png

    I am waiting for an answer to what could be the reason for this problem.
     
  27. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    So, v1.96 was finally submitted to the store!

    upload_2024-2-1_19-27-57.png

    Final changelog:

    - Added Light Mesh batching (performance improvement).
    - Added OpenImageDenoise2 (GPU) support.
    - Added Light Probe baking ability for BakerySectors.
    - Added Direct Light texture projection viewport controls.
    - Added a workaround for the infamous "Unity reimports the whole project" issue.
    - Added selected object highlighting to Atlas Preview.
    - Added baked reflection occlusion support to Bakery shader.
    - Fixed area lights captured by legacy Light Probes.
    - Fixed incorrect Meta Pass output on objects with per-vertex or "scale in lightmap = 0" objects.
    - Fixed lighting data asset application order in 2021+.
    - Fixed benchmark issues when project files are marked as read-only.
    - Fixed convex shape intersection when counting how many shadowmasked lights intersect.
    - Fixed cancel button not working when prompted about saving the scene using L1.
    - Fixed compressed volume direction.
    - Fixed BakerySectors not using _BaseMap/_BaseColorMap.
    - Fixed using *.asset files for color maps.
    - Fixed "Update Skybox Probe" on HDRP.
    - Fixed lightmap importing when "Parallel Import" is enabled in Unity (again).
    - Fixed baking SH/RNM and L1 Light Probes with 0 bounces and Shadowmask.
    - Fixed RTPreview marking objects as unwrapped without actually unwrapping.
    - Fixed objects with "scale in lightmap = 0" affecting atlas packing.
    - Fixed Sector preview using incorrect transform on 2022+.
    - Fixed progress bar not disappearing when baking prefabs on 2023+ until Bakery window was in focus.
    - Some UI fixes.
    - “Clear baked data” menu can now delete previously baked per-vertex streams, if desired (thanks kidkwazine)

    RTPreview was also updated to be compatible with this Lightmapper version.

    -----

    Got a reply from the dev: https://forum.unity.com/threads/ada...r-hdrp-in-2021-2.1238824/page-16#post-9596809

    upload_2024-2-1_19-34-20.png

    So... we're waiting for the API :)

    Lumen is a fully real-time solution (but with many temporal/filtering issues), APV is an efficient representation of volumetric baked lighting. They're sorta different techniques with different goals.


    It shouldn't be hard - you can check my existing graphs.

    1 means you only bake GI. Everything else is real-time, so it's not the fastest option.
    2 is the most reasonable option. Only dynamic objects are rendered to shadow maps. Light/Shadow application code is similar to-real-time in complexity, but there are less draw calls. Baked static / dynamic shadow mixing is perfect.
    3 works like (1) near the camera and like (2) outside the real-time shadow range. Not faster than (1), just renders something reasonable far away.
    4 is cheaper, but sucks, to be honest. It only works for 1 directional light, and requires all shadowed areas in the whole scene to have a similar color (set as "Shadow color" in the Lighting window), or mixing will break. The only case where it might work is a big flat outdoor area.
    5. Use projectors, blobs, decals, etc :D But no mixing then.

    It's actually a pretty hard problem, even on high-end platforms and outside of available options in Unity. I experimented a lot with different methods in my game and ended up making something between shadowmask and subtractive, but it requires a specific GBuffer to work. Basically I subtract shadows from a fully-lit image, knowing exactly what color to subtract (I have shadowmasks and albedo in the GBuffer + I know light color, radius, etc). It still has some problems though, even starting from texture filtering/denoising working somewhat differently for the lightmap/shadowmask, thus making the subtraction less accurate at shadow edges...

    I didn't write neither Unity unwrapper, nor xatlas (in case you use it) :)
    Maybe looking at the actual UV atlas (e.g. via Atlas Preview) will make more sense.

    Yes. Open .ftracelog.txt (not visible in Project browser, but openable in Windows) and find lines that looks like this:

    Device 0: NVIDIA blabla1 (ON)
    Device 1: NVIDIA blabla2 (ON)


    It should list all supported GPUs with a device number and a status (ON/OFF).
    Check what number your P40 is listed under.

    Then in ftRenderLightmap.cs, find this line:

    const uint deviceMask = 0xFFFFFFFF;

    ... which is a bitmask for all devices to enable. By default it will try to use everything, but max VRAM will be clamped by the card with the lowest amount, so indeed you can try disabling it.

    If P40 is Device 0, replace it with
    const uint deviceMask = 1;


    If P40 is Device 1, replace it with
    const uint deviceMask = 2;


    If P40 is Device 2, replace it with
    const uint deviceMask = 4;


    ... etc.

    Sounds like the HDRP exposure issue:
    https://geom.io/bakery/wiki/index.php?title=Manual#Notes_on_HDRP.2FURP

    (HDRP expects lights to have intensities like 10000, unless you tweak default exposure/HDRI intensity. Using dimmer lights will make them appear "pitch black").
    I recommend following the manual and making sure you can bake the examples (including the ones with Volumes).

    Bakery Volumes have a similar issue, except it's not about global meters, but about the voxel size you use. Walls shouldn't be thinner than a voxel. You can use 0.25m voxels, if you want (just set voxels per unit to 4).

    Actually interesting, I'm gonna study this paper. Another one related: https://advances.realtimerendering.com/s2015/SIGGRAPH_2015_Remedy_Notes.pdf

    Ah, thanks for reminding :D
    So the attenuation is already released!
    I've upgraded the roughness shader, so it has normal UI now. Can you check it? (see attached) If it's OK, I'm gonna include it in the base package.

    Yes, but now I'm stuck with it for historical reasons (like applying updates from the store).
    You CAN move the folder yourself, it's something I'm testing before every release, it shouldn't break (it did in early versions).

    Saw your DM. Copying, just in case:

    Is your prefab using the Lightmapped Prefab component, or it it a regular prefab?
    Lightmapped Prefabs have their lightmap linking data in "BakeryPrefabLightmapData" inside the prefab. If it exists and doesn't destroy on load, it should be fine.
    If it's not, check if following code will help:

    prefab.transform.Find("BakeryPrefabLightmapData").Awake();
    prefab.transform.Find("BakeryPrefabLightmapData").Start();


    I don't know, maybe the shaders/graphs are already in the project?... package importing logic is not under my control :)

    I don't think you need to commit this file if Bakery is already installed on another machine. It never changes.
    General version control recommendations are here: https://geom.io/bakery/wiki/index.p...2Fother_version_control_system_with_Bakery.3F

    In fact that particularly big DLL is only used by OptiX 5, the oldest (but gold...est) version which didn't depend on the driver as much. 6 and 7 have the fat part in the driver.

    No :(

    That's why there is RTPreview: https://assetstore.unity.com/packages/tools/level-design/bakery-real-time-preview-164462
    Most options are previewed with real-time feedback.

    Feel free to torture me (or friendly people on Discord) with more specific questions whenever you're confused or overwhelmed:)

    Ouch. Yes. Tried a few tricks, but actually I don't know how to make it work, since it's using some internal shader to paint reflection probes over the GBuffer independently of my shader:

    upload_2024-2-1_23-47-7.png

    I tried patching Occlusion data, but somehow it didn't work. Will try something else later.

    Bakery doesn't even check what render pipeline you're using in this case. When you clicked "Use Progressive" it switched the built-in lightmapper and saved it, so next time it didn't ask about it.

    Found the issue. Indeed, URP uses light settings a bit differently. Fixed it. Can you try the latest patch?
     

    Attached Files:

    Last edited: Feb 1, 2024
    Foreman_Dev likes this.
  28. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    Yep, since in Deferred it's all handled at once - it is possible to occlude reflections, I've done it for my GTAO implementation, but I am not sure how to do it using the lightmaps since those are packed into the data pass. Maybe you need to render them out manually somehow to an image buffer and pass it in as a global texture? No idea.
     
    guycalledfrank likes this.
  29. hadynlander

    hadynlander

    Joined:
    Jan 24, 2014
    Posts:
    41
    Hi there! First up: nice work on this plugin - I've only been experimenting with it for a few hours, but I'm already seeing it succeed in areas where Unity's lightmapper fell flat, especially with regards to smoothing out seams.

    Anyway, I've run into this issue when attempting to bake AO into vertex data:
    upload_2024-2-2_15-59-55.png
    This is the inside floor/walls of a highly subdivided cube with inward-pointing normals (i.e. a squarish room). Basically, whenever there's a sharp corner that's close to 90-degrees, the AO bake fails and the vertex ends up fully lit, creating those white edges.

    For reference, this is the same scene baked to a lightmap instead of vertices:
    upload_2024-2-2_16-3-2.png
    Ideally the vertex bake should look like this, too.

    Don't suppose there's a magic setting I might've missed which could fix this?

    Cheers!
     
    guycalledfrank likes this.
  30. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    143
    Thing is, I don't use HDRI, only PBS & volumetric clouds.
    I tried to play with exposure but after baking it's just removes sun for some reason, leaving with this results
    Screenshot_34.png

    Reference scene:

    Screenshot_33.png

    This is what I get when I switch to HDRI:

    Screenshot_35.png

    My settings
    Screenshot_36.png
    Screenshot_37.png
     
  31. stoppo

    stoppo

    Joined:
    Jun 11, 2017
    Posts:
    8
    Would it be possible to add MonoSH support to JBooth's betterlit shaders? I love using bakery and betterlit URP separately but can't really use them together if I wanna do MonoSH.
    I saw earlier in the thread that there was a guy in november who also asked; I know that this might be kind of a iffy thing because its not your asset so it might not be your call and stuff so completely understandable if not.

    lightmapmodes.png

    A bit ago I was trying to figure if I could hack it in myself but frankly I couldn't really figure it out lol, I thought to ask first before continuing to try
     
  32. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    I've had an issue pop up a few times and I've got no idea what the cause is, but here's what happens:

    I have a VRChat world that I've split up into sectors to keep managing the bakes easier (as everything has to be in a single scene). For some reason at random, when doing a sector bake, it simply won't bake the light probes for that sector. Doing another sector bake without changing any settings or anything (literally just click the bake button again) then succeeds.

    The terminal shows this when it happens:
    upload_2024-2-5_0-10-43.png

    Any ideas or what is needed to stop this from happening?
     
  33. YigitCetinkaya

    YigitCetinkaya

    Joined:
    Jan 4, 2021
    Posts:
    4
    Yes it works fine. If anyone has this problem, please update it on github, thank you very much.
     
    guycalledfrank likes this.
  34. HenryTownshend

    HenryTownshend

    Joined:
    Jun 19, 2017
    Posts:
    14
    Hey, I've read through this thread due to our lightmaps also been disappearing when entering play mode, which was driving me nuts.

    For anyone who has this problem, make sure you don't mess with the "Enter Play Mode" options in "Project Settings -> Editor" . Having domain and scene reload on solved the problem. No more disappearing lightmaps. Nothing to do with Bakery itself, nor with any conflicting third party packages.

    EDIT: Actually, Scene reload seems to be sufficient.

    upload_2024-2-7_16-51-23.png
     
    Last edited: Feb 7, 2024
    tolosaoldfan and guycalledfrank like this.
  35. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    191
    @guycalledfrank sorry, newbie question, where can I see which version of Bakery I am currently on? I want to go through your changelog and see what we've missed since we last updated but I cannot see our current version anywhere in the files..
     
  36. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    70
    hello.

    im using unity 2022.3.10f1. also updated everything from github.
    and i'm having this issue with the bakery preview.

    when i start it there is some "progess" and some sort "cmd popup" appears for a second and then it quits.
    i won't start the preview.

    any clue?
     
  37. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    131
    Is there still any possibility of getting network baking to work on MacOS? It's the only thing that's preventing me from having my dev environment be 100% on my M2 Macbook Air. I understand it may be a lot of work, could it be possible for others to contribute to the private GitHub or is everything related to that only in compiled form on there?
     
    Last edited: Feb 8, 2024
  38. HenryTownshend

    HenryTownshend

    Joined:
    Jun 19, 2017
    Posts:
    14
    Could we please maybe have an "Update RT Preview" button? Currently, you have to do two clicks to get your preview to update after you change something in the scene: One for "Close Preview" and one to re-open it. For lots of iteration and fine tuning, these really add up. An additional button "Refresh" or something that automates this to one click would really help.
     
    guycalledfrank likes this.
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    OK, I think I've fixed it, can you try the attached version (or via the patcher)?

    Thanks :)

    Interesting, I can reproduce this. It happens due to the Bakery's vertex color baking being rather unsophisticated - it just treats each vertex as a sample point, and such perfect corners confuse the sample adjustment algorithm, because it doesn't know where the "outside" is. There are at least 2 quick ways to fix this:

    1. By creating a dark shell around the box (e.g. by copying the same box):

    upload_2024-2-17_0-36-15.png

    2. By using smooth/averaged normals (so they're pointing in the same direction in the corners, on both walls):

    upload_2024-2-17_0-37-12.png

    Both options are not ideal though, and to solve it properly, Bakery really needs to sample multiple points over each triangle and average them, instead of just using vertices. This would also get rid of noise (currently no denoising can be applied to vertex colors). It's possibly not that hard to implement. Reply me with something, so I'm more pressured to do it the next time I come here :D

    In the meantime, I'm pretty sure there is also some script somewhere to project any textures into vertex colors with proper averaging, so that can be used too.

    Skylight with the intensity of 1 is basically pitch black in HDRP (compare it to your directional light intensity). Use this method to capture HDRP's sky and use it in Skylight: https://geom.io/bakery/wiki/index.p..._use_Skylight_with_a_procedural_sky_shader.3F

    You can also DM me some little test project and I'll configure it for you.

    There is something broken in BetterLit regarding Bakery support, and I couldn't figure out what, because I don't understand Jason's code, and he doesn't understand mine...

    There must be some way to reproduce/test it somehow :confused: Is it possible on a simple scene? Maybe keep the same light probe groups and sectors, just replace the geometry with a few boxes?

    Ah, interesting! That's actually very helpful to know. I wonder why NOT reloading a scene breaks lightmaps, if they're already applied in the Editor...

    Just hover your mouse over the blue text in the main window.

    (Added to the docs for future reference: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_know_my_Bakery_version.3F

    Honestly it's weird that I'm adding a "how to know your version number" to the docs, the UI is not amazing :p

    I actually tried to fit the version into the blue text or nearby originally, but it irritated me how it looked, so it ended up in the tooltip... )

    The version is just the "major" one though, corresponding to store releases. Every git commit in the middle is not reflected in it. But if you update via the patcher, you should be able to find bakery-csharp-cver.txt and bakery-compiled-cver.txt in the root folder of the project. They contain the latest installed commit hashes, corresponding to the ones you can see in github:

    upload_2024-2-17_1-4-50.png

    Does it print anything to .ftracelog.txt after it closes?

    The problem here is mainly the scene export code, running from frender/alphaBufferGen/uvGBufferGen dlls, which are using DX11 and WinAPI... and I don't have a Mac or any experience building something for a Mac.

    Namely the stuff there is:
    - Native process running, because Mono kept messing it up if paths had some unusual characters. That should be easy to reimplement.
    - Texture conversion/saving/loading. It can take direct DX11 resource handles and use them. But I also added a less direct RAM-based version of every function, so it works on DX12/Vulkan editors, so that shouldn't be a problem.
    - UVGBuffer rendering. Loads the scene from Bakery format, renders positions/"smooth" positions/normals/face normals/other stuff. Uses vertex/geometry/pixel shaders. Can use conservative rasterization. This is not gonna be easy to reimplement. However, it is possible to move it to the server, if I restructure the code a bit...
    - Alpha buffer generation. Somewhat similar situation, loads the scene, uses shaders to draw and pack stuff, can be moved to the server.

    So... turns out, it's not that impossible. First step would be to just move the complex stuff to the server, then get rid of my native process running for this case, aaaand I think it can work then o_O I'll check it next week (reply to this with something, just in case).

    Easy to add, but I'm a bit afraid of misclicking it by accident when wanting to close... on a huge scene, scene export time can be noticeable.
     

    Attached Files:

  40. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Hey Frank! I'm using betterlit shaders... and I noticed when I use bakery RNM I get specularity, but no reflections. I asked Jason, and he said to ask you haha. You can see here, the top floor tile is bls, the bottom one is bakery standard. Although the previous post reply regarding BLS is not encouraging :(

     
  41. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    So... assuming BLS is a lost cause, and I just updated my Bakery because I was super interested in the new specular occlusion stuff you added, but it seems to me like it takes away too much of the specular? It basically removes any lightmap specularity entirely.

    This is baked with RNM with lightmap spec enabled:

    upload_2024-2-20_15-6-25.png

    And if I enable "use lightmap specular as mask for reflection probes" (only on the wall mat):

    upload_2024-2-20_15-7-13.png

    This actually looks exactly the same as when I uncheck lightmap specular entirely.

    Is it broken?
     
    guycalledfrank likes this.
  42. HadynAtTitanium

    HadynAtTitanium

    Joined:
    Feb 5, 2019
    Posts:
    2
    *Reply*!

    Definitely keen on seeing a fix for this - we're looking at using Bakery's vertex bakes in our asset pipeline, and currently this is a significant issue. We've considered workarounds like reading values from texture lightmaps, but it adds complexity and extra processing to the pipeline which we'd rather avoid.

    Really appreciate you taking a look when you can :)

    Edit: I just realized I've replied from a different account (work rather than personal), but I am indeed the same Hadyn that originally flagged the issue.
     
    Last edited: Feb 21, 2024
    guycalledfrank likes this.
  43. miinoy

    miinoy

    Joined:
    May 27, 2019
    Posts:
    16
    Its been a while since you posted this but I also had issues with everything being dark due to exposure values and light values being WAYYY off in HDRP for bakery. Cant remember the exact values i used but I ended up getting it working by using a skylight and changing the values to something higher but more importantly makign sure exposure was set properly everywhere. I was also using the Realtime preview which was noticably way brighter because it doesnt take exposure and any of the default HDRP volume stuff into account(darker scene, ACES etc).

    Unless you are running into some kinda bug it should *work*. I ended up ditching APV in lieu of bakery + sphereical harmonics mode.
     
    guycalledfrank likes this.
  44. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    So I did that and tried it out, and it does seem to at least partially work - however, behaviour with materials of higher smoothness/lower roughness is weird. See the attached video - as smoothness shrinks the specularity, even though it should be coming from a reflection probe, just gets compressed into a single specular highlight. Is this just a property inherent to how this method works, or a bug of some kind? For me personally it's not a huge issue, I'm just curious if it's intended.
    Video:
     
  45. QQZZ2023

    QQZZ2023

    Joined:
    Feb 28, 2024
    Posts:
    3
     

    Attached Files:

  46. QQZZ2023

    QQZZ2023

    Joined:
    Feb 28, 2024
    Posts:
    3
    Hello, after I used the latest bakery1.96 version, a lot of black spots appeared during the baking process. May I know what could be the reason for this? I didn't encounter such an issue when using the same parameters with version 1.9501.
     
  47. praesidenter

    praesidenter

    Joined:
    Mar 5, 2016
    Posts:
    36
    Hi, I have two issues with Bakery:

    1)
    I am currently lighting a scene exclusively with a Skylight and Area Lights/Bakery Light Meshes. The baked lighting itself is fantastic, but I seem to have a problem with the light probes. I am using Legacy light probes, but they don't seem to take "direct" light from Area lights/Light meshes into account, only bounced light, making my light probes too dark in interior areas.
    Here are images of an isolated setup to demonstrate the problem. It's just a single Area Light/Light Mesh, a Skylight and Light Probes. I did two versions, one with a plane for bounce light, one without the plane and then did bakes for both light probe types.

    1 - Legacy Light Probes.jpg

    2 - L1 Light Probes.jpg

    2) I encountered a weird / unexpected behaviour when I increase the Texel per unit setting. Up to a value of 50 it's all fine and as expected, I get a handful of lightmaps in a reasonable amount of time (in my case 8 lightmaps in 15 minutes). But if I increase it to something like 60 or 70 and start a bake, I get a warning that a very large amount of lightmaps is going to be baked. When I proceed, it indeed bakes the lightmaps, but compared to the bake with the lower texel value it takes significantly more time to complete (almost 90 minutes) and creates literally hundreds of (mostly very small) lightmaps:

    2024-03-02 00_02_10.jpg

    I feel like this can't be right, especially since at slightly lower values, everything seems normal.
    Here are my baking settings if that helps:
    2024-03-02 00_26_19.jpg

    EDIT: I answered my second question myself by - surprise! - reading the documentation (more precise: the Troubleshooting section)! Turned out my Min resolution of my lightmaps was simply too low. Increasing it got rid of the warning before baking and reduced the amount of lightmaps.

    Thanks for any help!

    (by the way and just fyi I tried to get in touch via the mail on the publisher page, but didn't get an answer, maybe it's an old address? EDIT: The dev got back to me via email and solved the first issue with a quick patch - Thx again!)
     
    Last edited: Mar 2, 2024
    guycalledfrank likes this.
  48. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    Well, that was the original design to make them mutually exclusive, because reflections are unoccluded and it won't look much better with specular on top. So ideally either you choose SH specular for rough surfaces, cubemap for glossy surfaces, or... use that reflection occlusion feature I added to the latest update. Funnily enough I can't even find the source files for the BetterLit integration anymore, and it was tricky to "build" them in that system, but if you have them, combining specular with reflections should be as easy as replacing "=" with "+=".

    Actually yeah, seems like it does. Was discussing it yesterday on github. Can you try replacing your Bakery.cginc with the attached version instead? Should work better.

    Reply detected!

    Well... took me a whole day, but I managed to generate/bake/resolve samples. And now I expectedly found that it looks like crap at UV edges because the data is not filtered across the seam... gotta fix that tomorrow.

    Check it with the attached include also.

    Ouch, that shouldn't happen. Can you send me some little test project where I can reproduce these spots?

    :)
     

    Attached Files:

    Last edited: Mar 3, 2024
    hadynlander likes this.
  49. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    36
    Just did - looks much better! Thank you very much!
    However, I still feel like those dark spots get a fair bit too dark? Much darker than they should?
    upload_2024-3-3_13-36-45.png
     
    guycalledfrank likes this.
  50. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,669
    So I made it:

    upload_2024-3-3_18-14-55.png

    You can configure it in LMGroup settings:

    upload_2024-3-3_18-15-27.png

    Tested it on your box:

    upload_2024-3-3_20-8-14.png

    Not only it fixes light leaking and noise on vertex bakes, it also gives you free shadow anti-aliasing :)

    upload_2024-3-3_21-41-58.png

    Try the latest patch :)