Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

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

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

  1. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    194
    If it's from Humble Bundle, then bundle key also works for GitHub access.
    I still remember the day Frank told me that it already works while I was asking for it to work.
     
  2. NoxityGames

    NoxityGames

    Joined:
    Jul 1, 2018
    Posts:
    43
    I tried that, it never worked for me, and I do not have the bundle key anymore I don't think.
     
  3. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    194
    I just checked it myself:

    upload_2024-5-24_14-14-57.png

    Yeah it looks like it's long gone.
    Maybe you can contact Frank and find a way to go over it and prove the ownership somehow to gain access to GitHub repo.
    I personally prefer to get it from GitHub for both Bakery and Better Lit Shader.
     
  4. TahlyanSD

    TahlyanSD

    Joined:
    Aug 11, 2015
    Posts:
    4
    Hello.

    I am trying to bake a directional light in Unity HDRP. What script should I be attaching to my Main Directional (Sun)? If it is Bakery Direct Light (script), then when I select Match lightmapped to real-time, it is matching the Surface Color of the Celestial Body instead of the Light Appearance (Filter and Temperature) and Intensity in LUX in the Emission. I have not had any problems with the Bakery Point Light (script) matching the lighting and baking the lightmaps. But the Direct Light does not seem to work properly.

    Thanks in advance.
     
  5. KarlKarl2000

    KarlKarl2000

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

    I got this pop up when trying to do a bake. Should I be concerned? :oops:
    upload_2024-5-28_15-54-28.png
     
  6. TahlyanSD

    TahlyanSD

    Joined:
    Aug 11, 2015
    Posts:
    4
    @KarlKarl2000 I get that all the time when I am trying to bake more than a really small scene. Just hit continue and see if it bakes.
     
    KarlKarl2000 likes this.
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Can you send me any small test project/package to test it? I can't remember ever getting such issues. Unless you have Indirect Intensity set to some incredibly high value causing NaNs.

    Can you DM your github account to me? I'll add you.
     
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    It worked, yes. But then HB started "expiring" their keys, so you can't even see them yourself again. I helped a few people by generating new "invoice" codes they can use, but that didn't automatically added them to github. Patcher will still accept them.

    Correct.

    Oh god. This "Celestial body" thing didn't even exist when I coded it :D
    I checked and for me it actually uses the Light Appearance value:

    upload_2024-5-28_23-41-46.png

    Surface Color is just white here, but the light is matched to its Temperature. Is there a combination of settings to reproduce the issue?

    Yeah, it might take a while...
    https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_too_many_lightmaps

    If you don't seemingly have lots of lightmaps, but have lots of objects with lots of bakable LODs tweaked at wildly different distances, internally Bakery may end up rendering lots of sub-lightmaps for every world LOD state and then combining them into a smaller bunch. In which case it might help to not lightmap some of the least visible LODs.

    If you enable Checker Preview, it will print useful info to console after atlasing:

    upload_2024-5-28_23-47-14.png

    "Lightmap count" is the final count you'll end up having (depends on texels-per-unit, scale-in-lightmap, min/max resolution, lightmap groups...). "Bucket count" is the amount of sub-lightmaps in the lightmap (depends on different LODs/terrains/something else being inside one atlas).
     
  9. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    609
    guycalledfrank likes this.
  10. Game-Dragon

    Game-Dragon

    Joined:
    Nov 16, 2012
    Posts:
    39
    Hi @guycalledfrank
    Hoping maybe you can give some advice on this. I'm a complete newbie when it comes to shaders, so I probably missing something obvious. I'm trying to integrate Bakery Volumes into a Lux URP shader. Lux baked GI is retrieved from Unity's SampleSH() method, so I believe I want to replace this with BakeryVolume_float or BakeryVolumeSpec_float? Is that correct?

    This does indeed make the Bakery Volume work, but the colors and shading is wildly off. I believe I might be missing a step somewhere. I read the docs on implementing Bakery features to shaders, but to no avail.
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Sounds right!

    Are you sure Lux was using the result of ShadeSH as just diffuse lighting and didn't process it in some way?
    Also try changing the sign of viewDir coming to BakeryVolumeSpec_float, if your issues are specular-related.
    (Also specular should be added to emission, not diffuse GI).
     
  12. Game-Dragon

    Game-Dragon

    Joined:
    Nov 16, 2012
    Posts:
    39
    I see what my issue was. I'm so dumb. I was comparing my volume-compatible shader to the standard Lux shader, but somewhere down the line, I screwed up my light probes. So the lighting was actually incorrect on the Lux shader, not the Volume shader...
     
    guycalledfrank likes this.
  13. stephenhuang1

    stephenhuang1

    Joined:
    Aug 13, 2016
    Posts:
    3
    Hi there! Is there any way to get the examples to work in URP? (it seems like its mostly the materials that don't play nice with URP).
    I've tried upgrading them via unity's upgrade window, but no luck.
    I also was perusing through the documentation but didn't see anything.
     
  14. slingsandarrows

    slingsandarrows

    Joined:
    Oct 7, 2021
    Posts:
    2
    hi @guycalledfrank I'm hoping you can help. I've been banging my head against an issue with Bakery Volumes for a few days now. I have them working great in one scene in my project (Motel):




    But in my current scene (Home) dynamic objects act as if there are no Volumes active, and appear fully bright on light bake (or fully black, if I unload and re-load the scene.) Baked at low res for this test. Result is the same when baked at high res:

    all bright immediately after bake


    all black after reloading scene

    I can't tell why it seems that the system is failing to recognize the Bakery Volumes in this scene specifically. The bakery volume textures for the Home scene DO exist, and look about how I'd expect:



    I'm using URP, and my Bakery Volume settings and material/shader settings all seem pretty much the same in both scenes. They both use multiple Bakery Volumes, none of which are set to Global. The dynamic objects aren't using any special materials/shaders (just URP/Lit, which works fine in Motel, so it should work in Home..?) I'm not seeing console errors.. I only have Bakery Volumes in the scenes, no Unity light probes. I've tried clearing my baked light data in Home, both via the Unity Lighting window and the Bakery cache/lightmaps before re-baking; I've tried re-baking Motel using the same settings I'm using in Home to make sure my bake settings aren't breaking volumes somehow but Motel still looks right on re-bake... Is there some kind of known case where a scene can lose its references to Bakery Volumes even though they exist? Could the scene think the position of the Bakery Volumes is wrong, like off in space somewhere, even though it seems to be baking proper volume results based on how the resulting textures look? I am really stumped.

    Addendum: While reviewing the situation to make this post, as a test I tried clearing the lighting data in the Motel scene using the Unity Lighting panel, then doing a Bakery render-- and I had the same outcome as in Home, where all dynamic objects became black in Motel! In the case of Motel I was able to revert my changes and restore the proper lighting behavior-- but why would all dynamic objects in Bakery Volumes appear black when clearing Unity's lighting data and then doing a Bakery render? And how would I address this issue, aside from rolling back to a last known good version (which I don't have for the Home level?) Thanks for any help you can give!
     
  15. kungfuaxtiongrip

    kungfuaxtiongrip

    Joined:
    Nov 18, 2016
    Posts:
    2
    Hi all,

    I need some guidance please on how to best use Bakery's sector system.

    In the image below you can see a comparison between when I bake the light for the entire scene vs. using the sector system to bake the light in chunks: Sectors_vs_whole_scene.jpg

    From the example above I am baking the light for Sector A, and sampling objects from Sector B. After the bake, shadows in Sector A appear patchy [1], and seams along my road tiles have dark shadow lines [2]. You can see that I have none of these issues when I bake the whole scene like one giant sector.

    Since my scene is a largish city, I'd like to be able to use the sector system so I do not need to rebake the entire thing every time. Rebaking the whole scene is incredibly time consuming. Here are some close-up images of the bake after baking the Sector A group:

    Shadow seam:
    After_Bake_Close_Up_02.png
    Bright spots on red brick:
    After_Bake_Close_Up_03.png

    Patchy shadows:
    After_Bake_Close_Up_01.png

    In regard to the patchy shadows, I figure this is due to maybe needing more preview cameras, or maybe increasing the 'resolution' of the preview cameras (if this is even possible?) Here is a what my preview looks like for Sector A:
    What_Capture_Points_See.png

    Any help on how I can get my sector bakes to look like my whole scene bakes would be greatly appreciated! I can supply more information if necessary. Thank you in advance.
     
  16. slingsandarrows

    slingsandarrows

    Joined:
    Oct 7, 2021
    Posts:
    2
    Just a thought on the patchy shadows: visually it kind of looks like the light is shining through the backfaces of the mesh. I know it won't fix your other issues, but for that one perhaps you could try setting the mesh to two-sided shadow casting.
     
  17. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,668
    guycalledfrank likes this.
  18. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    118
    Feature request for you, Frank!

    Moving the Bakery settings for a scene to a scriptable object would be insanely helpful. It'd mean we can share settings between scenes, rather than having to ensure we load the right settings in for each one. Being able to plug that SO into the batch baker extension would be equally useful.

    If an object doesn't exist, it should make it in that scene's subfolder where probes, lighting data, etc is stored.
     
    guycalledfrank likes this.
  19. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Certainly: https://geom.io/bakery/wiki/index.php?title=Manual#Notes_on_HDRP.2FURP

    Hmm, how do you apply them to objects? They don't do it by themselves (except for Global). Check example_volumes_advanced, where I'm using triggers/receivers to actually apply local volumes to renderers. It's not the only way to apply them of course, but it depends on the game. I'd be glad if I could do it auto-magically on the engine level, but I can't change it :(

    Also, what shader are you using on your dynamic objects? (it needs to support volumes)

    Basically yes, that's the solution. Needs more capture points to fill the gaps. Sometimes it's annoying. Personally I ended up not even using sectors in my game, instead I just:
    - Split the world into multiple scenes.
    - In every scene have a bunch of border objects from other scenes (major shadow/GI casters)
    - Have their rendereres disabled, but leave Bakery Always Render on them.
    - Bake.
    - Remove these invisible objects from build (can be done automatically via script).

    Bakery treats all casters as double-sided anyway.

    At first I thought it's just light coming through holes in geometry, but looking closer, I think you're right!

    I can make that. Can you check if you can use Lightmapped Prefabs for that? They have a little known feature that lets them store/load current render settings:

    upload_2024-6-4_23-36-29.png

    The only difference here is that instead of a scriptable object, it's a prefab you need to drop into the scene and then click (kinda weird yeah... and wouldn't help the batch baker)
     
  20. PascalPieper

    PascalPieper

    Joined:
    Sep 14, 2018
    Posts:
    4
    Hi, I just wanted to bring to your attention (contacted you before, but not sure if Discord is the correct platform to communicate) that the URP shaders seem to break when updating to Unity 2022.3.30f +. It updates URP and Shadergraph to version 14.0.11. I'm using forward+ rendering. Now all URP shaders that I imported from the wiki (Latest URP graphs (rev 7.0) (12.1 - 16.0.4)) throw the following error:

    'SHADERGRAPH_BAKED_GI': Too few arguments to a macro call.
    Compiling Subshader: 0, Pass: Universal Forward, Vertex program with FOG_EXP2 _FORWARD_PLUS _MAIN_LIGHT_SHADOWS_CASCADE
    Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    Disabled keywords: DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON EVALUATE_SH_MIXED EVALUATE_SH_VERTEX FOG_EXP FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN

    Unfortunatly I don't have access to your github page in case that there already is an update available because I got Bakery via an old humble bundle. I bought the preview asset though seperately and have an invoice for that.
    Thanks for the great asset as always.
     
  21. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    118
    Possibly, but it feels a little clunky to do instead of just being able to assign an SO to a scene (and save that SO reference, rather than having to pop it into the window every time) and it'll automatically update without any user interaction. Because lord knows it'll end up being out of sync at some point.
     
  22. huangkisu

    huangkisu

    Joined:
    Sep 3, 2021
    Posts:
    10
    I'm having trouble achieving the desired lighting effect in my scene using Bakery. In the Bakery Preview, the lightmap colors are vibrant and the shadows are deep, as shown in screenshot 1. However, after baking the scene, the lighting effect is not as good, and the shadows are very faint and almost invisible.

    My target platform is Meta Quest, and I'm wondering if any settings are limiting the lighting baking effect. Could someone please help me troubleshoot this issue?

    Thanks in advance for your help!

    Let me know if you'd like me to make any changes!

    screenshot 1 Bakery Preview
    屏幕截图 2024-06-07 163209.png


    screenshot 2 After baking
    屏幕截图 2024-06-07 163253.png

    Bakery setting:
    upload_2024-6-7_16-47-31.png

    Light:
    upload_2024-6-7_16-48-40.png
     
  23. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    106
    I've had this problem before and now I have it again. My volumes will not bake. I tried deleting cached bakes, lightmaps and such, and baking and my volumes still won't bake.

    The only thing I did that I can remember is I patched Bakery a few days ago.

    I only noticed because I removed a light and baked and noticed my bakery volume still was acting like there was light coming from a spot I removed it. So the old volume texture was never modified.

    But yeah, my bakery volumes just show "Baked texture: none" even after a new bake. And "enable baking" is checked. Nothing has changed about my setup, the volumes just don't want to bake anymore. Everything else, my lightmaps and so on, are baking fine.
     
    Last edited: Jun 7, 2024
  24. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    81
    Hello, on a particular project, i have the error "Failed to write UVNormal" a lot while launching the bake. (Full Lighting / Baked Normal Maps mode)
    Sometimes if i cancel and relaunch, or bake again, i don't have the error and the bake is fine.
    Would you have an idea of where it's coming from ? It seems a bit unpredictable. Thanks !
    (obviously linked to Bake Normal Maps mode)
     
    Last edited: Jun 8, 2024
  25. miinoy

    miinoy

    Joined:
    May 27, 2019
    Posts:
    25
    Having this same issue. Just patched the other day and couldn't figure out what i was forgetting, my dynamic objects using BLS for SH are just black.
     
  26. miinoy

    miinoy

    Joined:
    May 27, 2019
    Posts:
    25
    As for the volume not baking and dynamic objects being black and not being affected by SH (using URP and BLS Shader) It looks like it DOES actually bake the volumes? But on the actual volume itself it tells me that the name doesnt match up. "Fix Object name" doesnt do anything and once you bake again it comes back
     
  27. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    106
    For me it's not even outputting the 3D texture for the volume. To make sure, I deleted all the existing bake files including the volume bakes. So I think I have a different issue.
     
  28. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    81
    Hello again, i'm responsible for the alternate lightmap scale you've implemented a while back.
    I think it's great, more predictable than the regular mode and i use it all the time.
    Still I have two requests :
    Could your algo guess the best resolution for a given "layout" ?
    Obviously, for the first LM there, a 2k map would be enough. I think it usually happens on the "last" lightmap.

    And then, when the "best resolution" is known for a lightmap, could you max out the UV layout so it takes the entire 0-1 space, so no texture space is wasted (like in the 2nd image) ?
    Thanks !
     
    Last edited: Jun 8, 2024
  29. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    106
    I know this may be an ill-advised workaround for obvious reasons, but I finally fixed the issue I was having above with my volumes not baking by... simply disabling the error. Seriously, I just commented the code out that throws an error:

    upload_2024-6-9_10-49-48.png

    Works perfect now, volumes bake again, everything looks good.

    Volume bake errors must be throwing false positives when nothing is wrong, aborting with error 4.
     
  30. GerardDiazPetoons

    GerardDiazPetoons

    Joined:
    Sep 20, 2022
    Posts:
    3
    Hi there! I have been working with bakery for a year or so, but have never tried any of the indirect modes. For this project in particular I am interested in (Distanced) Shadowmask Render mode particularly because we want to have a small effective radius of realtime shadows. However, when baking, the Shadowmask does not appear to have been baked.

    Distance Shadowmask is "On" because I want the realtime to do the heavy-lifting visually and use the baked shadows as a fallback for when realtime shadows are no more. I don't know if this can be the cause of the problem.
    upload_2024-6-10_17-18-0.png

    The baked directional looks like this. Apart from having the direct baked light we have a realtime direct light that is the main light source. The baked light should only do the indirect and shadowmask baking. I do not know if this is the most optimal setup.
    upload_2024-6-10_17-20-17.png

    When baking everything altogether the result is absolutely nothing. The baked lights look alright (though low quality since this is a test) but Shadowmask is non-existent.
    upload_2024-6-10_17-24-43.png
    upload_2024-6-10_17-23-37.png
     
  31. huangkisu

    huangkisu

    Joined:
    Sep 3, 2021
    Posts:
    10


    I think I know why my shadows aren't showing up - my resolution is too small and I've put my entire scene in one lighting group, which is affecting the quality. Currently, even after baking, my shadows still don't look like the ones in realtime, they're not dark enough. Although increasing the resolution to 1024x has improved the effect significantly, I've learned a lot from reading the bakery/wiki and I'll keep working on it!
     
    guycalledfrank likes this.
  32. TahlyanSD

    TahlyanSD

    Joined:
    Aug 11, 2015
    Posts:
    4
    My world is split up into smaller prefabs that are streamed/loaded as the player moves through the environments. I am currently able to bake lightmaps on these area prefabs and have the baked data be stored within each area prefab which is great. However when I placed reflection probes in an area prefab and bake them, the data is still stored in a folder with the scene. Is it possible to store the baked reflection probe data within an area prefab as well along with the baked lightmaps data using the Bakery Lightmapped Prefab?

    Also and somewhat related, what exactly does the Bakery Lightmap Group Selector do and is it necessary to add this script onto an area prefab that you want to lightmap? And what does increasing the Resolution from the default of 512 do? Also I do have L1 set in Light Probe Mode (was hoping this might make it possible to bake probes data into the area prefab). I am following this tutorial: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmapped_Prefab

    Thanks in advance!
     
    Last edited: Jun 10, 2024
  33. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    77
    Those look like Synty assets, you MUST enable Lightmap UV unwrapping on the models as they use like single pixel atlasing for the textures and thus won't bake properly normally. You'll likely also have to tweak the unwrapping parameters quite a bit to make them look good due to their design which is primarily for realtime lighting.
     
    guycalledfrank likes this.
  34. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    319
    Hi Frank,
    Is there a way to have objects included in lighting/shadow/gi calculations, but not be considered in the AO pass? The only thing I can currently think of is setting the emission in meta input to be somewhat high to counteract it, but that's definitely not the way to go ;)
     
  35. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    63
    hi,
    I would like to access the AO component of my bakery light maps from inside an amplify shader to do some fx. I see the community contributions have a script that outputs pngs from existing lightmaps, which is quiet awesome! but is it possible to just do that inside the shader? Doing a seperate process from inside of the shader.
     
  36. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Hmm I couldn't reproduce that with my latest graphs + 14.0.11 + Forward+. Possibly related to some other URP settings in your project. Can you send me your URP asset + URP renderer asset as a unitypackage to test?

    My shader graphs are public/free, there are no updates for them on github, you can just grab them from the wiki.
    However, DM me your HB email, it should have at least some code in it, and I'll get you proper github access too!

    OK, I've added something. It's not yet compatible with Batch Baker*, but here is what you can do now (if you update via patcher/github):

    - Set settings to Experimental mode. Scroll down and see the new Presets rollout:

    upload_2024-6-12_18-36-39.png

    - Click New to save current settings to a preset or select it:

    upload_2024-6-12_18-37-27.png

    While a preset is inserted, you can't change other settings manually - they're picked up from the preset instead.

    - Clicking "Modify preset" allows you to change all settings again - and they will be stored to the preset and reflected in other scenes using it:

    upload_2024-6-12_18-39-56.png

    So hopefully that's somewhat helpful!

    * by that I mean you can't force a single preset in the Batch Baker. But scenes in the list will use presets assigned to them.

    What I see is that your UVs are totally messed up in the baked version. Are you using Generate Lightmap UVs on your assets? Also try Checker Preview and check how many texels do you have on these objects. If the UVs are fine, but there are 0.01 Texels Per Unit, it's also possible. You can increase Scale In Lightmap on tiny mesh renderers also, without changing global Texels.
     
    BenWoodford and laurentlavigne like this.
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    ...oh, OK, you figured it out :)

    Not sure why that can happen. Can you send me some test project/unitypackage? It's enough to have a few cubes and the problematic volume. Any console errors during/after baking? Are you not rendering any Sector, just full scene(s)?

    Aha.

    I suspect you're just seeing the old volume, not a new bake.

    Can you show me the full error message?

    Huh. Have you tried the latest patch? There was a fix related to that. Is your disk (the one with the Temp Path) very slow?

    Wait, your dynamic objects need to use Volume, not SH. Can you show your shader UI?

    This is harmless/unrelated.

    There is a problem with xatlas, it assumes all atlases are of the same size. If you use my default atlas packer, it can do differently-sized ones.
    Technically I can just crop xatlas result also, if it fits in a much smaller size...

    It goes against the "alternative" mode logic, because it's all about uniform texel sizes. Non-alternative does this 0-1 normalization, but alternative prefers empty padding over random texel sizes.

    Weird. What version of URP are you on? Pre-10 didn't support shadowmask; some newer needed it to be enabled in settings; 12+ definitely shouldn't require anything extra.
    Can you run my shadowmask examples in your project? E.g. example_shadowmask: https://geom.io/bakery/wiki/index.php?title=Manual#Viewing_example_scenes_on_URP

    I think it's possible, but after baking you need to change your reflection probe from "Baked" to Custom and put the rendered probe texture into it manually (or via script). "Baked" is scene-relative; "Custom" stores everything on the component, so it will get saved into the prefab.

    It groups everything under it to a single named lightmap atlas (or vertex-baked mesh, if needed). Without it, Bakery will generate as many atlases as needed for the given texel density.

    Not necessary. Only if you want more control over lightmap count/naming or override lightmap modes on certain objects.

    It gives you more resolution...

    Light probes cannot be a part of a prefab. Unfortunately Unity doesn't support it. Volumes can though.

    Not currently... what are you trying to achieve with it? Are you sure you even need the AO? It's not really a physical effect anyway...
    Since Bakery just multiplies AO over lighting, it is possible to write a little script (see API reference) that would:
    - Bake lighting
    - Toggle some objects' "cast shadows"
    - Bake AO
    - Get AO maps
    - Multiply and save
    - Revert "cast shadows"
    Ping me again if you're stuck with it, I'll write something for you.

    You need these PNGs so your shader can read them. The AO data is not stored anywhere else. If you bake lightmaps with AO, it's just multiplied over them, and you can't really decouple it at this point. You can try doing some color processing on the lightmap (tweaking intensity/contrast, summing channels with different weights) to get some AO-ish result, but it depends on your lighting a lot.
     
    Autarkis and laurentlavigne like this.
  38. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    63
    Got it, is there anyway I can have bakery to embed those AOs into the alpha of the lightmaps it spits out?
     
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Lightmaps are HDR. On desktop that would mean using BC6H format that doesn't have alpha. On mobile it's either RGBM (alpha used to decode HDR) or dLDR (pretty bad quality, unless all your lights have intensities <= 2; depending on compression might also not have any alpha either, e.g. if using some ETC1).
    You can use uncompressed RGBA16f with AO in the alpha channel, but I'd rather have AO as a separate compressed map to save memory. If your intensity range is very low you can get away with dLDR in some compressed RGBA format (DXT5/ETC2/ASTC...).
     
  40. Vincentin

    Vincentin

    Joined:
    Feb 4, 2017
    Posts:
    10
    Hi, Frank!

    I think I've encountered some strange behavior with reflections with the latest update where you've added MONOSH support in BLS.

    I've reproduced the problem in clean in Unity 2022.3.33f1 URP and updated Bakery and BLS to their latest version published in the Asset Store (I haven't used the Git versions).

    It seems that when activating the Bakery tab in BLS the reflections of the reflection probes do not take into account the Smoothness information of the MaskMap. It happens in all Lightmap Mode. At first I thought it was something of the new Specular Mode configuration but it seems not.

    Without Bakery Enabled
    WithoutBakery.jpg

    With Bakery Enabled
    WithBakery.jpg

    Also the Screen Space Reflection (LimSSR) has stopped working with the new update, before there was no problem, also in any LightMap Mode and I have also checked with all Specular Mode options, I know you have nothing to do with that but I report it just in case it is related to the problem and it is helpful.

    Best regards!
     
  41. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,458
    if you switch to cook-torrance you'll get close to HDRP, and if you want a good laugh, switch to ASE > custom lighting > add a GGX node.
    from memory, the rest of HDRP look can be done with a good grade.
    in a way, we're lucky that HDRP is so average looking :D
     
    guycalledfrank likes this.
  42. GerardDiazPetoons

    GerardDiazPetoons

    Joined:
    Sep 20, 2022
    Posts:
    3
    The shadowmasks are working as intended in the example (had to change materials because everything was pink). We are on URP 14. In our actual scene, shadowmasks are being baked but somehow not applied...

    Thanks for the reply by the way. Admirable how you keep in touch with the community!

    upload_2024-6-17_11-52-43.png
     
    guycalledfrank likes this.
  43. eof2007

    eof2007

    Joined:
    Apr 18, 2020
    Posts:
    8
    Hi!
    Can you tell me how to do a proper bake if I have 2 meshes in each prefab, but I use an alternate component instead of LOD Group?
    At the moment I'm getting artifacts due to closely spaced meshes.
    001.jpg
    Bakery has no functionality to point to LOD meshes?
     
    Last edited: Jun 17, 2024 at 4:06 PM
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,687
    Somehow it seems to work in my test scene. Maybe a different URP version... can you send me some little test project to debug? (Not sure how to debug the SSR if it's a separate asset though)

    Well, thanks :) I can see purely real-time shadows on the screenshot. Do they fade properly to the baked shadowmask / visible when Distance shadowmask is off? If it works, is there any difference in your (non-example) scene setup?

    Hmmm do you mean you have your own LOD system? Since Bakery doesn't know about it, unlike built-in LODGroups, it will just bake all geometry inside each other. However, you can:
    a) Don't mark LODs as static and just use probes/volumes on them.
    b) Setup standard LODGroups by script just for the sake of baking and remove them automatically. There are events you can subscribe to: https://geom.io/bakery/wiki/index.php?title=Manual#Events
    OnPreFullRender and OnFinishedFullRender specifically. You can add LODGroups in first and then remove them in second.
     
    laurentlavigne likes this.
  45. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    102
    Hello, I have migrated an 2021.3.36 project to U6 preview 6.000. After migrating, the rendering made with Bakery is corrupted (see screenshots). Then I upgraded Bakery to the last version => same issue (I didn't rebake the lightmap). Originally , the Bakery-baking was made on a PC, then exported through the wiki instructions to be used on a Mac editor (worked well with U2021). Any suggestions ?( I'd prefer to avoid to rebake on the PC, because all the process was long and time-consuming). BakeryNOK-U6.jpg BakeryOK-2021.3.jpg
     
  46. Vincentin

    Vincentin

    Joined:
    Feb 4, 2017
    Posts:
    10
    Well, that's strange. I've tested again and it's still the same. I am referring to the reflections of the reflection probes, not to the specular highlights of the baking result.

    Here I have exaggerated a little the smoothness and metallic to make it look better.
    I have set the specular mode to none so that only the reflection probe is visible.
    It is a BLS material with a maskmap in main only.
    Light baked with dominant direction, I have also tried with SH and MonoSH and the same thing happens.
    Unity 2022.3.34f1 URP 14.0.11, Bakery 1.96 and BetterLitShader 1.1.42.
    Captura de pantalla 2024-06-20 114052.jpg

    As for LimSSR, it was just because the thing is about reflections and I thought it could be related. The project is on Github if you want to take a look at it.
    This is with LimSSR.
    Captura de pantalla 2024-06-20 121427.jpg
    https://github.com/JoshuaLim007/Unity-ScreenSpaceReflections-URP

    I have the project only with Bakery, BLS and LimSSR, I just sent you the link.

    Thanks and sorry for the inconvenience, Frank, I keep thinking that you have nothing to do with BLS either and it makes me feel bad :oops:
     
    Last edited: Jun 20, 2024 at 2:59 PM
  47. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    81
    Thanks for your answers. The alternative mode request was because i had to use unintuitive values with huge delta to approach Unity behavior. Now i have nothing against exploiting a texture to its full capacity if it means using a slightly "better" texel ratio.
    But maybe i got the default mode wrong if it already max out the best resolution/texture number for a given scale.