Search Unity

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

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

  1. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Bakery lightmaps get stored in a folder called
    BakeryLightmaps
    (see "Output path" at the bottom of Bakery) inside your Project. Select all your lightmaps and in the Inspector, set the
    Compression
    to
    None
    .

    Also, in case you target Android, be sure to read this.
    .
     
    guycalledfrank likes this.
  2. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    Hello. I have been running into this error today when baking my map with terrain. Yesterday I baked and it was just fine. I also can't find the logs they are referencing. Today I am getting these errors when trying to bake my terrain:
    upload_2021-10-15_14-38-15.png
    upload_2021-10-15_14-38-23.png upload_2021-10-15_14-38-30.png
     
    Last edited: Oct 15, 2021
  3. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    It gets stuck on "Adjusting sample points"
    upload_2021-10-15_14-50-25.png
     
  4. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    So, I just bought Bakery, is there any guides available to use this asset in URP and HDRP.
    I'm using HDRP primarily but am working on a URP project for a game jam as well. It would be really helpful to have some tutorial or guides available for these pipelines.:)

    Some demo scene would be really helpful
     
    Last edited: Oct 17, 2021
    JamesArndt likes this.
  5. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    Quickstart guide on how to generally use Bakery:

    Check the "Notes on HDRP/URP" section from the Manual:
    Also, on the Manual main page, there are links to the latest URP and HDRP shader graphs.

    .
     
    guycalledfrank likes this.
  6. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Currently it seems Bakey doesn't detect light temperature that are used in HDRP, is there a way around this? I have to manually edit the color to get it to match approximately and it's really hard to do so for any color other than white
     
    Last edited: Oct 18, 2021
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    OK, I'm back home and feeling much better now. Still months to fully recover, but I can work. Wasn't covid. It was some silly virus (epstein-barr) that most people get sick with as kids. Somehow I managed to never contact it for 31 years, and now it got me pretty bad (mononucleosis), even had to spend a week in a hospital because I could barely eat/drink/sleep.

    Thank you!

    No idea. Do example scenes work? Can you send me any test package/project where I can debug it? Maybe the scene is not unwrapped?

    Not sure if I understood it correctly. How is prefab used across the scenes? How is it connected to dynamic meshes?
    If dynamic non-lightmapped objects are affected, apparently they are lit by probes or the global ambient probe. Do you have light probes in the scenes? Do you bake them? If not did you try "Update skybox probe" in each scene?

    Check this: https://geom.io/bakery/wiki/index.p...2Fother_version_control_system_with_Bakery.3F

    URPDirSpec has specular, while Baked Normal Maps or default direction-mapped shaders don't provide it. Maybe it makes the difference? Did you try changing specular/glossiness?

    That's a hard crash. Does it happen with example scenes as well? I'm only aware of it happening because of:
    - Old driver version
    - Some "security" software killing the process (avast, etc) for no apparent reason, in which case Bakery executables should be excluded there

    See: https://geom.io/bakery/wiki/index.p....2FGI_without_having_a_lightmap_on_its_own.3F

    Not planned at the moment. Scene export process uses some Win32/DX11 specific code which is a pain to port (especially given my lack of Mac programming experience).

    Pretty sure I fixed both of these before... can you send me any unitypackage/project to debug?

    Bottom row has -1 x scale:

    upload_2021-10-18_17-13-47.png

    Third row is in a prefab:

    upload_2021-10-18_17-16-24.png

    There must be something more complex going on...

    Reflection probes are rendered by Unity, I just call the built-in method. Does it work without Bakery?

    Yes, it's totally OK.
    BTW, latest version (github) limits its size to about 1 MB, so it doesn't grow indefinitely anymore.

    Are you sure it's not realtime shadowmap bias? I.e. does it disappear if you disable realtime shadows on the light, by any chance?
    Meta pass can't affect the look of the object in normal rendering. If the object is lit by light probes, only some realtime shadowing can produce such patterns.

    Technically there shouldn't be anything preventing Bakery meta pass code from compiling without CG dependencies, the code is regular HLSL.

    Does it work if you do?
    It probably just doesn't like exposed properties that are not added to any cbuffer.

    Does it happen with every scene, even example scenes? Does alt-tabing the editor fix it by any chance? Do you have any lightmapped prefabs?

    Looks to me like broken UVs? Is "Generate lightmap UVs" enabled on all objects?

    See: https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good

    Answered here: https://forum.unity.com/threads/bak...preview-released.536008/page-112#post-7498115
    Basically, just update via the patcher: https://geom.io/bakery/wiki/index.php?title=Github_access
    The fix will be on the asset store branch soon.
     
    Last edited: Oct 18, 2021
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Yes, it's out of VRAM. Perhaps today you have some other VRAM-intensive software open in background?

    Try disabling Terrain Optimization. If it's disabled, make sure you don't bake hundreds of lightmaps. You can enable Checker Preview, and it'll print estimated lightmap count to console. If it's a high number (e.g. 100 or more...), reduce texels per unit.

    I added temperature support recently. Try updating via the patcher: https://geom.io/bakery/wiki/index.php?title=Github_access
     
  9. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    thank u so much!! that did the job!! and thanks for posting the android tip!..
     
  10. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    based of that android link...this is also what fixes it (see attachment)...lightmap encoding needs to be set to high in player settings.
     

    Attached Files:

    Last edited: Oct 18, 2021
  11. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    I'll try and work up a package after this next release, try looking at this scene in RT preview, i'm not sure if the issue affects baking in general. My bad that wasn't clear.
     
    guycalledfrank likes this.
  12. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    EDIT:
    Unity's own Progressive CPU give a far better result.

    After more than a few test I managed to bake shadows, I'm still having a few issue mainlyu with black spot on meshes.
    I attached baked and non baked scene

    BAKED
    Immagine 2021-10-19 201434.jpg

    NON BAKED
    Immagine 2021-10-19 201455.jpg
     
    Last edited: Oct 20, 2021
  13. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    142
    guycalledfrank likes this.
  14. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    "Solved" by crazily increasing Texels per Unit to 40
     
  15. OfficialDeVel

    OfficialDeVel

    Joined:
    Oct 11, 2020
    Posts:
    10
    Hello.
    What's the difference between shader BakerySHGraph and BakerySpecSHGraph? ;)
    Decals should use default hdrp shader or also bakerysh?
     
    Last edited: Oct 22, 2021
  16. SaiKiranKotha

    SaiKiranKotha

    Joined:
    Jul 11, 2020
    Posts:
    4
    Hello!
    I have a problem with reflection probes in Unity 2021.2
    probes sometimes bake completely black or sometimes bake correctly but doesn't apply if I reload the scene.

    upload_2021-10-23_19-50-23.png
     
    alodel and fuzzy3d like this.
  17. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    22
    No, the specular for some reason behaves differently on different platforms. On android it looks ok, but when i switch to PC everything is over-specular. Do you have any idea?

    We can get something that looks like a normal result if you do this (in BakeryDecodeLightmap.hlsl) (not ideal, but not over-specular):
    [line 103] float4 lmColor = unity_Lightmap.Sample(samplerunity_Lightmap, lightmapUV) * 0.01;
    But it breaks the visuals of the android version.
     
    Last edited: Oct 24, 2021
    guycalledfrank likes this.
  18. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hey Mr. F, I wish you a good recovery.

    How can i deal with L1 probes negative values within URP ? I don't really get what cause it and how to avoid it.
    Is your volume thingy prone to the same artefacts ?
    I have a dark attic scene, with one large emissive window, and some other openings on an exterior with a skylight/sunlight. The lightprobes are wonky. All dynamic objects have an ugly dark reddish side. I've pushed the exposure quiet a bit.
    As soon as there is come contrast around the probes, there will be such artefacts ? I don't get how people can even get decent result.
    edit: documentation says through bakery shaders ?
    Thanks
     
    Last edited: Oct 26, 2021
  19. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Another question
    I have hard times to set correctly the cookie texture with urp. It's like the projection isn't aligned with light local z direction whatever cookie texture option i set.

    And also :p
    Would it be technically possible to add the postprocess settings to the real time preview ?
     
    Last edited: Oct 26, 2021
  20. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I hear you, it would be too inconvenient. OK, added support for Receive GI = Light Probes:

    upload_2021-10-27_22-8-32.png

    If, for some reason, it'll break older scenes for other users where it didn't use this option, this behaviour can be disabled:

    upload_2021-10-27_22-9-45.png

    Please try the latest patch: https://geom.io/bakery/wiki/index.php?title=Github_access

    Why crazily though? Did you use Checker Preview before baking? It could quickly show you texel density before waiting for the bake.

    SpecSHGraph has baked specular approximation, while SHGraph is just diffuse.
    Not sure about decals, hmmm. I don't know how they're implemented in HDRP. If they can use any shader graphs from regular non-decal materials, then it should work.


    Weird. Bakery simply calls Unity's own internal method to bake reflection probes, precisely this one: https://github.com/Unity-Technologi.../Mono/Inspector/ReflectionProbeEditor.cs#L304
    What happens if you just select any of your reflection probes and click this?

    upload_2021-10-27_22-20-29.png


    Ah yes. Looks like I didn't take different lightmap encoding into account in URP graphs.
    Can you check if replacing the attached file works (you may need to also open the graph and click "save asset" to rebuild it)?

    Thank you!

    There is BakeryURPNonLinearLightProbe shadergraph that uses the geomerics trick to remove any negative values from the light probes.
    Volume shaders also use the same trick.
    High contrast lighting causes it, that's why while L1 is decent for indirect, it may not be great for storing strong directional lighting.
    For typical shaders, as a last resort, you can somewhat trade L1 contrast vs negative values. In ftAdditionalConfig.cs decreasing convL1 while increasing convL0 will do that.
    You can also use legacy light probes that don't have this problem.

    Seems like there was a bug that I recently fixed. Can you check if the latest patch fixes it?

    Might be possible to make preview render before in-engine post-processing in the scene view, I thought about it before. Not sure about URP/HDRP though.
     

    Attached Files:

    Noors84 and matiasges like this.
  21. SaiKiranKotha

    SaiKiranKotha

    Joined:
    Jul 11, 2020
    Posts:
    4
    I have tried it. It does the same thing. btw I am using URP, I'll try again in the official 2021.2 release and see
     
    guycalledfrank likes this.
  22. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Decals don't support any type of GI, as far as I know. You just won't find such inputs in the Decal Master Stack. They also can't overwrite anything GI related when applied to a surface with, say, a lit material. Further, if you have materials that use Bakery specular (that is connected to the emission input), you won't be able to overwrite the specular of those (using decals) to a lesser value, because you can't subtract from the emission using decals, only add to it. It's just one of the current limitations.
     
  23. analogupstudios

    analogupstudios

    Joined:
    Jul 3, 2019
    Posts:
    14
    Good afternoon/evening [respectively]. I cannot seem to get Bakery to work under HDRP Unity 2020.3.19f1. I have done the Bakery 'Detect Optimal Settings' and find that Optix is missing with my NVidia 2060 card. Is there a way to by-pass Optix requirements so that I may render the scene without ray-trace [considering in unity DX12 Dev is in its infancy and gives serious engine issues when deployed]? Any suggestions on how to overcome this would be greatly appreciated.

    Furthermore, I am getting the 'Out of Memory' Error even though I have everything set in the outlined material on your site [i.e., lowering resolution, enabling GI VRAM to On, etc. Any way of resolving this as well?
     

    Attached Files:

  24. Brackaterts1

    Brackaterts1

    Joined:
    Jan 13, 2018
    Posts:
    8
    Hi, running into an issue where any value past 10 texels result in no change in quality of scene lighting. Is there some cap happening on the atlas? Atlas has reached max size in mesh render component. How do I go higher? Basically I cannot make the checker preview give me smaller boxes unless I assign lightmap group selector and select 8k. Using Generate lightmap UVs for mesh, but mesh does have UV1s for textures.
     
    Last edited: Oct 28, 2021
  25. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    Hi! Are you still planning to integrate runtime lightmap blending in Bakery?

    Also, I'm not very experienced with lightmapping, and have been trying to research if Bakery w/ realtime lightmap blending would be a plausible way to handle a day-night cycle in my open world—realtime shadows have been a killer on my drawcalls. It's currently one ~6km x ~6km scene, but is well-suited to be transitioned to a multi-scene streaming approach. From what I've seen of your earlier posts in this thread, this is not really a great fit for baked lighting, but it also sounds like recent changes (esp BakerySectors) might have moved the needle on this.

    I know every project involves a lot of variables that make generalization hard, but are there any rules-of-thumb or heuristics you can recommend for determining if Bakery would be a good fit for something like this? It's been difficult to find up-to-date information given how much changes year-over-year with SRPs, tech stream/LTS disparities, etc.
     
  26. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    8k is reaaally big.And yes by default you can only go up to 4k.Your object size is just too big and it takes the entirety of the 4k map. You have to cut your object in pieces if you want higher res.
     
    guycalledfrank likes this.
  27. Brackaterts1

    Brackaterts1

    Joined:
    Jan 13, 2018
    Posts:
    8
    Is there anyway to overflow the lightmaps onto a second 4k lightmap?
     
  28. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    142
    I can't even bake with 0.5 texels because is running out of memory. Have tried to tweak some things but it's the same.
     
  29. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    22
    Thanks, looks better, but still too grey. Maybe the reason, that android lightmap baked in dLDR.
     
  30. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    You have to split your object in several objects. An object supports only one lightmap.
     
  31. Brackaterts1

    Brackaterts1

    Joined:
    Jan 13, 2018
    Posts:
    8
    So if I separate my mesh by materials.. I can get the preview checker to give me smaller boxes aka more precise lighting. After doing that I can push texels to 43 before I get no more detail.

    My understanding also is my drawcalls would remain the same so performance isn't affect at all.. since the mesh is statically batched on play. I did a quick comparison of different mesh configurations to understand what's happening with Bakery. I always thought if you increase texels Bakery would spit out more lightmaps but that is not true. All three pictures had texels around 300 which ensures maximum box density.

    Picture 1: one mesh (console predicts 2 lightmaps)
    Picture 2: upper and lower half separated, which about doubles box density (3 lightmaps)
    Picture 3: separated by materials (15 materials), highest box density, but inconsistent (16 lightmaps)

    Mr. F, can you clarify my findings? With picture 3, the box density of each material is totally different so how would I maintain consistent quality other than manually decreasing each mesh renderer's "scale in lightmap" in the unity editor until all boxes are around the same size? All 3 meshes are using Generate Lightmap UVs in mesh import settings. Would the solution I want require manually making UV2 lightmaps in Maya? Not familiar with the process.
     

    Attached Files:

    • t.gif
      t.gif
      File size:
      1.1 MB
      Views:
      354
  32. roundyyy

    roundyyy

    Joined:
    Dec 23, 2019
    Posts:
    112
    Hi, Would you have any idea why my scene is failing to finish bake? It was baking fine yesterday, bit confused cause just started to use your tool yesterday, so I might be doing something wrong.

    UPDATE :
    post-packing causing this, disabling helps

    UPDATE2 :
    downloaded patch and helped :)

    Thank you
     

    Attached Files:

    Last edited: Nov 5, 2021
  33. cursedtoast

    cursedtoast

    Joined:
    Apr 27, 2018
    Posts:
    62
    Is there a way to prevent lights from casting shadows on specific objects? I have a shadow being cast on an object four times in my scene and it looks pretty terrible. I tried the group selector, and set only one of my lights to a matching bitmask as the problematic object, but it still receives shadows from all the lights in the scene.
     
    Last edited: Nov 1, 2021
  34. orzech123

    orzech123

    Joined:
    Mar 12, 2018
    Posts:
    17
    How to make realtime lights illuminate only dynamic objects and in the same time have the static one not affected with the realitme lighting (only with baked lightmaps) AND have still shadows casted from these dynamic objects onto the static objects lightmaps?
    Is that possible? Currently I was playing with Light's (Unity) Culling Mask and everything works with that exception that if I disable static object's layer there, they stop receiving shadows from realitme enlighten dynamic objects.
     
  35. KhoraDev

    KhoraDev

    Joined:
    Jul 13, 2017
    Posts:
    2
    Hi Bakery community! Sorry to hear about Mr. F.
    Maybe a seasoned Bakery user has the answer I'm looking for.

    Is it possible to use Bakery with Unity's default lightmap handling? If I don't use lightmap groups or any lightmap adjusting.

    Rant: I've tried and tried on several commercial projects to strictly follow the version-control sync guidelines, but I'm very alone at work with the troubleshooting and the only one who can confidently sync up a computer to a Bakery lightmapped project, most of the time, but if it's not lightmap scrambling that's giving me a headache then it's lightmaps being omitted in builds. Boss has gotten cold feet with Bakery and now I'm trying again, again to get comfortable with Unity's own light baking. It's an absolute nightmare. I make graphics for VR, so the lightmap resolutions need to be very high. In interior architectural renders there's around 20-30 lights. Bakery eats through it with no issue, even if the final bake takes 3-7 hours it'll work through it consistently.

    If there's a way to use Bakery's baking algorithm but keep everything else Unity standard to avoid possible sync issues, please share!
     
  36. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    I also have the problem that Bakery doesn't work with reflection probes in 2021.2. Here's what I did:
    - Create a new project with the 3D template (so using built-in) in 2021.2.0.
    - Import bakery, set to Linear
    - Open example_lights, put a reflection probe on the plane
    - Bake, then bake reflection probe -> reflection probe looks ok
    - Press play -> reflection probe becomes gray
    - I then exit Play mode, clear Bakery data, clear all lightmaps, then bake with Unity's GPU baker
    - reflection probe stays ok even in Play mode
     
    guycalledfrank and SaiKiranKotha like this.
  37. analogupstudios

    analogupstudios

    Joined:
    Jul 3, 2019
    Posts:
    14
    Is there no fix to my problem?
     
  38. f4rj4

    f4rj4

    Joined:
    May 2, 2014
    Posts:
    2
    Hey everyone!

    I've been using bakery to make lightmaps to be downloaded dinamically through asset bundles. The thing is that even when the bake looks fine in the editor, qhen the assets is downloaded the lightmap looks weird, like if it has an offset or affecting the wrong uv set.

    The thing is: this only happens in some assets. As you will see every asset in the no scene is baked as independent and they all are gathered together as a big prefab containing other prefabs as dependencies.

    Anhone has any idea why this happens? It looks like the bug only occurs on downloaded asset bundles since the editor base prefab looks fine.
    Here is the example. On top is the downloaded asset bundle, where the lightmap fails on 3 assets: toilet, handwasher and kitchen bar.

    Below is the asset as it is shown in the editor.
     

    Attached Files:

  39. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    394
    Thank you for creating a solution for lightmapping in Unity - I've struggled with the native lightmapper for years and I'm so glad I found Bakery. I've played with settings and found the Distance Shadow Mask in SH mode yields the best results for our project. I'm using the URPSHSpecGraph shader for static meshes as we are running URP.

    There is an edge case I'm not happy with - not sure if a bug or a flaw of the method I'm using but the real-nice baked shadows appear disappear when the camera is within a certain radius and a light that was baked in a later pass was added. Not sure if it was because it was added later or because there are too many lights within the shadow range or some other reason?

    Outside of shadowmask range:


    Inside shadowmask range:



    Inside shadowmask range but other light deactive:



    I'm ideally looking for a solution where I can add as many baked lights as I would like with the super nice lightmapped shadows always present for static meshes.

    Any help is appreciated. thanks! Jake
     
    guycalledfrank likes this.
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    It's not possible that all denoisers are unsupported. Possible causes:
    a) Assets\Editor\x64\Bakery\hwtestdata\image.lz4 (or the folder where it was moved) doesn't exist for some reason. Try updating.
    a) Some version control system or something else locked this file from writing, thus breaking the denoising benchmark. Make sure the file is not marked as read-only (although since v1.9 Bakery does check for this flag and tries to unmark it).
    c) Some dubious AV software decided to block the denoisers for some reason (exclude Bakery executables from their list): https://geom.io/bakery/wiki/index.p...g#Baking_any_scene_crashes_with_unknown_error

    Benchmark results can be modified, so it won't stop you from using the denoisers. Just edit these checkboxes on ftGlobalStorage.asset:

    upload_2021-11-6_18-52-47.png

    Out of memory right at the start sounds like there is simply too much geometry in the scene (or there are other VRAM-intensive programs open).
    If you have any painted terrain trees, disable their effect (built-in lightmappers always ignore them): https://geom.io/bakery/wiki/index.php?title=Manual#Export_terrain_trees
    If you have lots of high-resolution terrains, enable "terrain optimization" (although it doesn't run with RTX): https://geom.io/bakery/wiki/index.php?title=Manual#Terrain_optimization
    Possibly don't bake the whole scene, only important objects with complex lighting (I don't know the scale/complexity of your world).

    Assuming I answered you (?) on the Discord a few days ago, I'll just repeat it for others:
    Single mesh can't be split into multiple lightmaps, Unity can't do that. If a single objects is hitting maximum lightmap resolution, it can't go further. It is possible to:
    - Split the mesh into smaller chunks, so each chunk uses its own large lightmap.
    - Use a Lightmap Group, as it allows selecting 8k (but beware of memory usage).

    Eugene did that recently with his "Magic Lightmap Switcher" asset: https://assetstore.unity.com/packages/tools/utilities/magic-lightmap-switcher-built-in-rp-192332

    For smooth indirect lighting it's possible. But for sharp shadows you'll need an impractical amount of lightmaps.

    Fun fact: recently I was thinking about STALKER and how it had a legacy DX8 mode without any real-time shadows, but still with dynamic time of day. How did it work?
    Well, turns out, the shadows never moved. Their lighting was simply (sunLightmap * sunColor + skyLightmap * skyColor), where sunLightmap and skyLightmap are grayscale static maps, and colors changed dynamically. It's funny how I never noticed that shadow angle was always the same.

    Also, you can create one big combined shadowcaster mesh (or a few). Disable shadowcasting on real objects and set these objects to "shadows only". Unlike real objects, shadow geometry mostly doesn't have to be split by the material, so you can save many draw calls.

    Yes, it might be doable. With caution.

    OK, I installed Android module to test it properly and reproduced the issue, but was unable to understand why it happens so far. Something changes somewhere inside URP shaders, making it treat the inputs differently. Color/directional maps are unaffected, they look the same on both PC/Android (apart from different compression), but the specular is different.

    Yes, it was patched, please try the latest patch: https://geom.io/bakery/wiki/index.php?title=Github_access

    Not really. Bitmasks allow filtering lights from objects, but you can't remove a shadow. Shadow is just an occluded area of the light. Bitmasks can disable lights per group, but then your object will be just dark.
    You can possibly hack it using LODs, as higher-resolution LODs don't receive shadows from lower-resolution LODs (that is, from LODs having farther distance), but I won't recommend that.
    Possibly you can just make the shadows blurrier, by increasing shadow spread?

    Try shadowmask mode:
    https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html
    https://geom.io/bakery/wiki/index.php?title=Manual#Shadowmask

    Yes, they're optional. Groups are not used unless you explicitly add them to objects. UV adjustment can be disabled:

    upload_2021-11-6_18-25-28.png

    This way version control/merging should be trivial, the data is simple if UV adjustment is not used.


    Couldn't reproduce it on 2021.1.7, so must be some 2021.2 bug. Technically "Render reflection probes" just forces the editor to click this button:

    upload_2021-11-6_18-32-51.png

    Do you have the same result when clicking it manually instead of "bake reflection probe"? (assuming "bake reflection probe" was "Render Reflection Probes" in Bakery menu).

    I'm not sure how bundles are built, but it is possible that Unity strips UV2 from models thinking they don't have lightmaps. If "optimize mesh data" affects the bundles, it might be the cause: https://geom.io/bakery/wiki/index.p...iated_at_runtime_in_a_build_have_no_lightmaps

    Also I'm not sure how your objects are split into bundles, but it's important to know that lightmap->object links are stored within an invisible scene object. It is possible that some of your bundles have this object, thus lightmapping works, and some don't. In this case it is better to bake them as Lightmapped Prefabs, as each prefab is standalone and carries all lightmapping data with itself: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmapped_Prefab

    Also, in case of asynchronous loading, try calling ftLightmaps.RefreshFull() right after the asset is loaded. This will re-apply all lightmaps to all lightmapped objects.

    Thanks :)

    "Distance shadowmask" uses fully real-time shadows inside the shadow range. Possibly your real-time URP light doesn't cast real-time shadows though? Looks like they're disabled by default, but can be enabled in the URP asset:

    upload_2021-11-6_18-51-23.png
     
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Added HDR mode to RTPreview today:

    upload_2021-11-6_18-57-41.png

    It transfers linear HDR image from RTPreview to Unity, meaning it is possible to apply tonemapping and other postprocessing on top:

    upload_2021-11-6_18-59-15.png

    Note that it's still only usable in Standard RP for now. SRPs don't seem to apply any postprocessing (or run at all) when SetSceneViewShaderReplace is used.
     
    cursedtoast likes this.
  42. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    Thanks for the detailed reply! I saw Magic Lightmap Switcher—it looks fantastic. Does its release mean that it is being taken off the roadmap for Bakery? It'd make total sense if it was, I'm just asking so I can understand what tools will be available for implementing these things.

    That STALKER detail is wild—I absolutely didn't notice that either, though I was probably too busy being blown away by dynamic weather in 2007.

    The combined shadowcaster mesh is a great idea, and probably works well with the kind of mesh baking I'll have to be doing anyway. I'll give that a try, thank you. Do you think using that for direct lighting and Bakery lightmap blending for indirect lighting would be plausible, or would that be prohibitively system-intensive?
     
  43. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Can I read up on some best practise advices regarding HDRP and bakery? Should lights' lux values still be in ranges of 10^3 to 10^5 or does bakery require lower values?
     
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I guess so. I didn't come up with a nice universal way to switch/blend lightmaps and to set up different lighting scenarios. Blending is especially complicated, given the SRPs. MLS took Eugene many months to make and debug all corner cases (I was following his development), and I'm not sure that I want to dive into it myself. Blending/switching is also a very isolated feature, as it's less about baking and more about the runtime.

    Yeah you can actually see it clearly in the old trailer (timelapses start at 1:34):

    And yes, it was only like this in the DX8 renderer. If you had a decent card back then and could enable its DX9 deferred renderer, then sun shadows were fully real-time. Sky lightmap was still used.
    But I wonder if their DX8 approach is still feasible for modern mobile games.

    It may be feasible, especially using URP. When using standard RP forward renderer, note that simply enabling any shadowed directional light will force Unity to render the whole scene TWICE, first with depth-only shaders, then with forward shaders (not even counting shadowmap draw calls). This is just the sad design of standard RP.

    If you're on v1.9 or newer, high intensities should work. Make sure to set denoiser to OptiX 7. Also, just in case, get the latest patch: https://geom.io/bakery/wiki/index.php?title=Github_access
    Bakery's own examples are baked using lower intensities comparing to HDRP, so example scenes need some adjustments: https://geom.io/bakery/wiki/index.php?title=Manual#Notes_on_HDRP.2FURP
    RTPreview doesn't understand HDRP post-processing, so reducing its exposure is essential when working with HDRP scenes.
     
    Marco-Sperling and gewl like this.
  45. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    Thanks again for the reply, that's very helpful!
     
  46. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    394
    @guycalledfrank thanks for your input. Turns out I've abandoned using Shadowmask as I find its just too expensive and opting for Full Lighting with Light Probes. I'm currently using BakeryURPDirSpec to get environment reflections from reflection probes and fake specular. However, its not clear to me where the Smoothness/Roughness map is picked up? I've tried putting it into the Alpha channel of the Metallic Map but not seeing any change so maybe that property isn't sampled that way? Where should I be putting my smoothness map?

    [EDIT]
    Ok scratch that I've just seen the boolean that activates the texture driven sample!

    Thanks! Jake
     
    Last edited: Nov 7, 2021
    guycalledfrank likes this.
  47. Faikus

    Faikus

    Joined:
    Jan 3, 2011
    Posts:
    241
    Yes, happens as well, but strangely sometimes only after I save the scene after baking. So I tried it now on the newest 2021.2.1f1. Create a new scene, two static objects, a directional light with bakery component, a skylight and a reflection probe. Turn off mixed lighting Lighting Settings, then bake with bakery. Then bake the reflection probe in Lighting Settings. Then when I play either the reflection probe gets grey immediately or only when I save before.
     
    guycalledfrank and SaiKiranKotha like this.
  48. AliceWasNeverHere

    AliceWasNeverHere

    Joined:
    Aug 16, 2021
    Posts:
    11
    Hiya Frank et al,

    I've been through the Bakery manual, but haven't yet wrapped my head around required Bakery modifications for Unity area lights.

    In my "self-study" art gallery project, Unity area lights act as a sort of "interior directional light" (wall to wall at ceiling height casting towards the floor) to provide ambient indoor illumination. There must be a better method for base interior lighting than my workaround, but I didn't grok it in my time spent on that challenge. o_O

    I'm teaching myself WebGL game development using Unity 2020.3.22.f1 + URP and the latest Bakery/RTP patches from Github on an old i7-2600k 16G system with a new RTX 3070 Ti.

    Perhaps related to my attempts at making area lights (Bakery light mesh) work is this streaking of lightmaps. Is it obvious to anyone what could be causing this?

     
    Last edited: Nov 13, 2021
  49. Daniel_Dickinson_RCad

    Daniel_Dickinson_RCad

    Joined:
    Apr 3, 2021
    Posts:
    9
    Hey

    We use Bakery for ArchViz (Thanks for adding IES lights btw!). We're now investigating adding a path-traced camera mode for clients to capture higher quality/resolution renders. Currently our approach to this is toggle on a bunch of Unity's real-time lights & try to get them to match our Bakery setup as closely as possible.

    My understanding is that your Real-time preview uses the path-tracer. You also have a bunch of experience using denoising platforms such as OID & OptiX. Have you consider making a path-traced renderer? I'd wager a fair portion of your audience is in a similar position to me & would happily pay a hefty premium for it. Even if Unity do add a denoiser themselves swapping between lighting ecosystems is a little painful. Alternatively could you point me in the right direction using your Previewer to do so? Just generating path-traced equivalents via code from Bakery lights would be a dream. Finding a denoising solution would definitely be a bonus.

    Wishing you a speedy recovery,
    Dan
     
    guycalledfrank likes this.
  50. cursedtoast

    cursedtoast

    Joined:
    Apr 27, 2018
    Posts:
    62
    Thanks, I'll try that in the future. I was able to get around it by putting the walls that the object cast a shadow on multiple times into a group. Then I duplicated my light sources, one version that didn't affect the bitmask of those walls, and one that did, but didn't cast shadows, and only affected that said bitmask. So the walls got lighting from all lights it normally should, but only shadows from the specific light I wanted them to have shadows cast from. Now my TV isn't casting an awkward shadow four times from four light sources.

    Kinda a janky solution, but it got it done in that particular use case.

    Unrelated, but I get some weird artifacts in random spots in darker scenes. Seams can sometimes appear in these said darker scenes as well. Any suggestions? I cranked up the brightness in the screenshots to make it easier to spot.






     
    Last edited: Nov 11, 2021
    guycalledfrank likes this.