Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

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

  1. matiasges

    matiasges

    Joined:
    Jan 24, 2021
    Posts:
    139
    How can I clear the whole cache/data after a render?

    - I did a render but it got cancelled, however I lost 15GB of memory. After that I selected the option to "clear baked data and delete lightmaps files" and the space hasn't been restored.
     
  2. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Thanks for the speedy replies and help!

    I was testing Single Pass Instancing for Virtual Reality (VR) in Unity 2020.3.25f1 with mixed lighting and Distance Shadowmask in outside areas. That said I went back to Unity 2019.4.34f1 yesterday, because Single Pass Instancing no longer works correctly in Unity 2020.3.25f1 for the deferred rendering path. Which is what I'm using in my project, due to light usage optimizations and reducing draw calls. So this is no longer an issue for myself.

    I tested with the updated Bakery.cginc you sent and the issue still happens, mostly after Bakery lightmapping completes and the project / scenes reload. If I reimport the shader the issue goes away with the Bakery > Standard shaders. So not a big problem, just a minor inconvenience.

    So it's one of the options in the XR Management Plugin which is an additional package to install in Unity.
     
    guycalledfrank likes this.
  3. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    39
    I’ve built a scene in another project. I use Bakery for light maps. I want to export this scene to another project or client.

    What’s the proper way to do this with bakery? In the docs it says add certain scripts. I’ve done that. But, the exported scenes do not include Bakery light maps. Something is breaking or missing.

    I think this would be a common requirement for users who do not want to clutter projects or are preparing scenes for others.

    Any recommendations on this? I don’t want to send whole projects with the Bakery asset included.
     
  4. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    for the record

    I updated to Unity 2021.2.7 with BetterLit 1.2.22

    The Bakery checkbox flags are reseted (to off) after scene and project save.

    - BetterLit says that materialproperty block is in use when i activate the Bakery checkbox.
    - The first scene play works fine.
    - The checkbox flag is then turned to off after scene save and project save.

    Could it be that the material propertyblock is responsible for switching the checkbox off?
    Does anyone has anquick fix here?
     
  5. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    Have you bought the 2021 adapters for Better Lit? If not, it is not officially supported on 2021, which is why that isn't behaving as you'd expect.
     
  6. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    i use the Better Lit Shaders
    https://assetstore.unity.com/packages/vfx/shaders/better-lit-shader-189232

    do you refer to the Better Shaders?
    https://assetstore.unity.com/packag.../better-shaders-2021-standard-urp-hdrp-205770

    After bake the BakerSH specular works nicely. (red circle - Bakery checkbox enabled)

    1.JPG

    After saving scene or saving project the Baker checkbox is set to off (red circle).
    You have to reenable it again before every scene start.

    2t.JPG
     
    Last edited: Jan 12, 2022
  7. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    217
    Hello, I have a forest area of my scene and I searched the thread for "forest" and I see it was mentioned that it is a bad idea to lightmap a forest and indeed when I do try, I get a warning that it would create 188 lightmaps and going ahead with it, the lightmap baking didn't complete and gave me an out of memory error. My trees had "Contribute Global Illumination" set to true and "Receive" set to light probes.

    Is there a way to fake this, or maybe an alternative to lightmapping in this case, or am I just out of luck here? I was hoping to be able to darken the light probes in the forest as well as the ground lighting. I tried rendering the entire scene with the trees "Contribute Global Illumination" off, then attempting to just do the light probes after enabling the trees "Contribute Global Illumination" but Bakery gave an error saying that objects had changed and I need to use the "Render" button to bake the entire scene. I tried with the Light Probe option set to Legacy, but the progress never left 0%.

    Edit:
    Maybe it's worth noting that my ground is made up of normal meshes rather than a Terrain.
     
    Last edited: Jan 13, 2022
  8. ThisGuyThatsHere

    ThisGuyThatsHere

    Joined:
    May 4, 2016
    Posts:
    11
    One more question- Why isn't checker preview consistent?

    I have set up the scene to have the texels distributed one way, but then after a unity restart they are in completely different proportions? Suddenly checkers that were matched, are now about 3x the size apart. It gets even worse if I change the texels per unit.
     
  9. pwka

    pwka

    Joined:
    Sep 19, 2012
    Posts:
    49
    I would really like to be able to force cast shadows while baking. I have disabled this in the mesh renderer for performance reasons, but I still want to have baked shadows. Is there a solution for this?
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Are other LODs lightmapped (marked as Contribute GI)?
    If it's marked with Contribute GI (even if Scale in Lightmap is set to 0), it can override your value.
    So check if:
    - Contribute GI is disabled on these LODs.
    - Perhaps try Bakery->Utilities->Clear baked data before the next bake, just in case.

    The idea of SH lightmaps is to bake using vertex normals, but not a single color; instead, we approximate different colors coming from different directions to a hemisphere around this vertex normal. When a normal map is applied, it can blend these different colors.
    If you want to take normal maps into account directly during baking, try using Directional Mode = Baked Normal Maps. This is not compatible with SH, and normal map detail resolution will depend on lightmap resolution, but it will trace directly from normal mapped directions.
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    If you mean the temp/cache folder, its default path is C:/Users/You/AppData/Local/Temp/frender.
    If you try the latest patch, there is a menu option now (Bakery->Utilities->Clear cache).
    It is always safe to clear this temp folder, unless you want to rebake with disabled "export geometry and maps", "update (un)modified...", etc.

    Hmmm... do you also use Shader Tweaks (e.g. bicubic interpolation)? It has another usage of this sampler state.
    Patched it too. Can you try
    - Replacing the attached file in UnityEditorFolder/Data/CGIncludes
    - Replacing the attached file in Editor/x64/Bakery/shaderSrc (in case you decide to tweak the shader tweaks again)
    - Restarting the editor
    ?

    Yeah, exporting with mentioned scripts should work. Check if:
    - Lightmap texture assets are actually present in the project.
    - Get Debug Tools: https://geom.io/bakery/wiki/index.php?title=Community_extensions#Debug_Tools
    - Click Bakery->Debug Select Storage. Is anything selected? Is there a component with "Show debug info"? Click it.

    upload_2022-1-14_12-25-37.png

    - Scroll to "maps". Make sure the maps are listed there:

    upload_2022-1-14_12-26-16.png

    - Scroll to "baked renderers". Make sure the objects are listed there:

    upload_2022-1-14_12-26-50.png

    If all these things are OK, lightmapping should work. If Debug Select Storage doesn't show anything, then you probably forgot ftLightmapsStorage.cs. If maps are empty, then you probably forgot the maps. If anything is empty/missing, it's also possible that you first imported the project without any scripts, then added the scripts later, but Unity already killed all script properties in the scene. Make sure to export/import both scene/maps/scripts as one. Try exporting as .unitypackage, as simply copying the files may result in Unity giving them different GUIDs, thus breaking all script references.

    I don't know about the BetterLit checkbox behaviour - you better ask @jbooth . As for the MaterialPropertyBlocks: these can be indeed in use if you're using RNM/SH lightmaps, as additional maps are supplied this way (because there is no other way in Unity).

    Bakery didn't really respect "Receive GI" option until recently, as it's older than this option. You can do the same by setting Scale in Lightmap to 0: https://geom.io/bakery/wiki/index.p....2FGI_without_having_a_lightmap_on_its_own.3F

    Or you can apply the latest patch where I actually made it take "Receive GI" into account as well.
    Latest patch also has some optimizations on lightmap count when using LODs.
    So with these two fixes alone it should already get much better. But still, forest is a forest, and they can take an awful amount of memory.

    If you have multiple LODs, try only marking the lowest resolution LOD as "Contribute GI", and disable it on more detailed LODs (I still recommend also applying the patch first).

    In my game I currently have a special very coarse tree mesh for baking with 85% of leaf triangles removed and the rest scaled up to compensate (aka "stochastic LOD"). These meshes are invisible in the game, but have BakeryAlwaysComponent to show up in Bakery. For distant forest you can even use some billboard-like geometry for lightmapped shadow casting.
    In my case the trees are lit via Volumes (2 voxels per unit), and it gives them some soft self-shadowing and GI:

    upload_2022-1-14_12-44-42.png

    Weird, I didn't notice that before. Is there any way I can reproduce it?

    You can create some invisible object (Mesh Renderer disabled), but add BakeryAlwaysRender component to it. This way Bakery will always render it, but it won't be visible in Unity.
     

    Attached Files:

  12. ThisGuyThatsHere

    ThisGuyThatsHere

    Joined:
    May 4, 2016
    Posts:
    11
    Yes, I've just created a fresh project on HDRP (u2020.3.25f1) and imported a few simple meshes (walls which are mostly made from individual planes in different shapes and a ballustrade which is made from multiple small and curved shapes, I can send them privately).

    Now, these meshes have "generate lightmap uvs" checked. And at first the texels are consistent between models from the same fbx, but the ballustrade's default texels are much larger. So, I use the "scale in lightmap" property to add more detail to them, but if I do that the rest of the instances suddenly become chaotic in their texel size. One wall's texels are suddenly 3x the size of another. In general, whenever I use that property, the checkers also change in size after a restart. Even if I later revert the changes (but then the texel distribution is wasteful anyway).
     
  13. slakdevelopacc

    slakdevelopacc

    Joined:
    Jan 5, 2016
    Posts:
    14
    I don't use SRP, terrain optimization is off by default because I use RTX. The picture you sent is not aimed at finding the problem. To get the problem, you need to make a hole in the terrain and then position the mesh in such a way that the first part of it is on one side of the terrain and the second on the other side. 123.png
     
    Last edited: Jan 14, 2022
  14. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Hey, so I'm having some discrepencies with the RTPreview. For example, in preview...

    upload_2022-1-14_19-1-3.png

    And the final render

    upload_2022-1-14_19-1-15.png

    The shadows are all but gone and the result is MUCH, MUCH brighter. This isn't bad with punctual lights but as soon as I tried light meshes, this started to become very noticeable; especially the issues with brightness.

    Note this is not related to lightmap resolution; I've increased the resolution a LOT and still am having the same result.
     
    Last edited: Jan 15, 2022
  15. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Love this real live example of light constribution.

    FB_IMG_1642338571750.jpg
     
    vlery, guycalledfrank and JuanGuzmanH like this.
  16. kypronite

    kypronite

    Joined:
    Apr 15, 2013
    Posts:
    21
    I have very strange error where this black splot artifact appear on my terrain.
    i try to render 3 different scene and all come up with black splot.
    Is bakery supported for terrain with multiple neighbors/tiles ?

    I also used magic light probes but disabling them didn't do anything.
    I also try clear lighting data before baking but same back spot appear after baking.
    fyi, my terrain is also used microsplat shader.
    and my graphic card is 980 ti.
    My unity version is 2020.3.25f1 and latest bakery version (just installed yesterday)

    I'm wondering what config did I miss?
     

    Attached Files:

    Last edited: Jan 16, 2022
  17. JuanGuzmanH

    JuanGuzmanH

    Joined:
    Feb 8, 2018
    Posts:
    70
    Hi! Im using the translucent feature with success on the some curtains through the window and it works really good. THe white white curtain has a different group with a less density compare to the black curtain and everything it works as expected.
    Then Im trying to simulate the same effect on the black lamp that you can see on the scene, I would like to have translucency on the lamp. I tried with:
    - with mesh lights
    - point lights
    - super strong intensities
    - diferent levels of density on the bakery group...
    - taking my own second UVs for the lighting on the model...

    The thickness of the lamp surface is similar to the curtains (about 3 milimeters)...

    But I can not reproduce the same effect and Im running our of ideas.

    Can be that this effect can only happen with the main direct light from the scene and no with others?

    upload_2022-1-16_21-13-36.png
     
  18. ThisGuyThatsHere

    ThisGuyThatsHere

    Joined:
    May 4, 2016
    Posts:
    11
    Regarding my issue with inconsistent texel sizes- I now understand why that was the case. It was due to scale issues, me not fully understanding uv padding and uv padding changes not being noticed by unity. I never baked lightmaps before and I thought that everything regarding texels would be truly automated, but oh well :shrug:
     
  19. mbelzileha

    mbelzileha

    Joined:
    Jan 17, 2022
    Posts:
    1
    Hello Mr Frank! I work at Ubisoft and we recently purchased some licenses for Bakery to work with. We are currently trying to run Bakery from command line in batch mode. We are encountering some difficulties we were hoping you could help us out with.

    The first issue we faced was that the bake did not seem to be progressing. We then understood Bakery relies on Unity's Update being called so we had it be manually triggered in a loop until it is done.

    Now, Bakery renders until 100% where it says "Finished rendering" but stays stuck there. After some debugging it seems ftRenderLightmap calls LoadScenes() and waits for the scene to load but it never does.

    Any thoughts on where we are going wrong?

    Thank you greatly!
     
  20. AB3D_PL

    AB3D_PL

    Joined:
    Dec 15, 2015
    Posts:
    1
    Hello. I have a problem with light leaks on solid geometry. There are correct UV for lightmaps. It happens when Indirect values are higher then 0. How can I fix it? I'm working on HDRP project.


     
  21. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Terrain hole shape is always the same, whatever settings/lights are used. I can't see any problems here:

    upload_2022-1-24_11-46-48.png

    upload_2022-1-24_11-47-3.png


    upload_2022-1-24_11-47-15.png

    upload_2022-1-24_11-49-10.png

    It is possible that you're using some customized terrain shader with some half-texel offset for the hole texture or something.
    If you can send me any small test project/package. I'll check it.

    Looks like tonemapping/post-processing in the engine? What is your render pipeline?
    RTPreview renders linear values with no post (only sRGB correction).
    If you're on the standard pipeline, you can grab the latest patch, enable "HDR" and "Render in scene view" checkboxes in the preview window, and then post-effects should actually work correctly with it. For HDRP there is currently no way to make it match.

    It's also possible that you're using some customized shader that adds some flat ambient lighting over the lightmap (I would expect some shadows at least between the table and the wall). Does it look better with standard shaders?

    Actually I didn't test it before (if I remember correctly, this feature didn't even exist in Unity when I was writing terrain support for Bakery).

    Seems to work though (they're just multiple regular terrains):

    upload_2022-1-24_12-5-7.png

    Are you on the latest patch?
    Also try it without Terrain Optimization (although it still works in my case).
     
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Definitely not, it works with all lighting (even indirect). Let me try it...

    Test mesh:

    upload_2022-1-24_12-39-23.png

    Settings:

    upload_2022-1-24_12-39-46.png

    Now enabling SSS with default settings:

    upload_2022-1-24_12-40-5.png

    Of course if the lamp is black, it'll be darker. Make sure it's not really 0,0,0 black. With dark, but not completely zero albedo, the effect is still visible after a rebake:

    upload_2022-1-24_12-40-55.png


    BTW, make sure to get the latest patch, as there were a bunch of fixes to SSS recently (I should already release it to the store!)

    Well it's mostly automated (at least it should be). This option in the patched version should give the most consistent results:

    upload_2022-1-24_12-43-57.png

    Hi! Awesome! :) How do you use the command-line? I guess you launch Unity through it, not using Bakery's command-line directly?

    Yeah, within Unity the bake is stepping a coroutine inside EditorApplication.update. This way it's non-blocking.

    I need to learn more about your bake launching approach. Can you please DM me with more details?

    You're Przemysław, right? I emailed you.
     
  23. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    436
     
  24. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    I figured it out; I needed to use double-sided geometry. The ceiling was one-sided, and RTPreview was using the backface but the lightmapper was letting the skybox through. Thanks for the response, though :)

    Speaking of special shaders, I noticed in the URP shader graphs for SH and light volume, it just adds the specular and does not attenuate by light distance:

    upload_2022-1-24_12-4-51.png

    This works fine most of the time, but means that for a fully-baked scene, in dark areas the specular highlights/reflections are just as strong as in bright areas. For example:

    Baked w/ volume shader, no specular:

    upload_2022-1-25_14-23-10.png

    Baked w/ volume shader + specular:


    upload_2022-1-25_14-23-22.png

    I see this there, but it is always normalized. Is the length of that vector usable as attenuation?

    Code (CSharp):
    1. float3 dominantDir = float3(dot(nL1x, lumaConv), dot(nL1y, lumaConv), dot(nL1z, lumaConv));
     
    Last edited: Jan 25, 2022
  25. rdunnePT

    rdunnePT

    Joined:
    Jun 10, 2021
    Posts:
    2
    Hey,

    Receiving a console error wondering if you have a fix that doesn't require installing the terrain component.

    Thanks

    Code (CSharp):
    1. Assets\Bakery\ftLightmapsStorage.cs(447,17): error CS1069: The type name 'Terrain' could not be found in the namespace 'UnityEngine'. This type has been forwarded to assembly 'UnityEngine.TerrainModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'Terrain' in the Package Manager window to fix this error.
     
  26. slakdevelopacc

    slakdevelopacc

    Joined:
    Jan 5, 2016
    Posts:
    14
    I found the root of the problem. Apparently Bakery relies on the texture that describes the holes (which is somehow related to the "Base Texture Resolution" parameter), while the rendering of the landscape relies most likely on other sources. Therefore, there are inaccuracies in lighting when working with holes. In principle, this is a solvable problem.

    BTR.png

    I hope that helped you.
     
    Last edited: Jan 25, 2022
    guycalledfrank likes this.
  27. pwka

    pwka

    Joined:
    Sep 19, 2012
    Posts:
    49
    Sadly I can't afford to duplicate so many assets (unity gets super slow and people starts yelling at me ;)). A script that forces shadowcasting for baking would be easier in ma case. BakeryAlwaysRender is also super useful script.

    One other problem I have is that 'Match lightmapped to real-time' does not take into account the Radius of the light source.

    I think that Baked contribiution should be linked to Mode in Light when you press 'Match lightmapped to real-time' (but I'm not 100% sure;)). After the lightmap is baked the Light inspector shows incorrect settings. For example, mixed lighting with bakery set to Direct And Indirect is no longer mixed but Baked, and the inspector is lying to the user ;) Light set to Baked with Indirect Only in Bakery is actually Mixed with wrong inspector (you cannot access realtime light options until you change it to mixed. It can lead to pretty big problems when baked light starts to cast realtime, hight resolution shadows ;)

    One last question - When baking in SH mode, is there a way to turn off reflection baking for selected lights?

    Thanks for fast responses and super useful tool.
     
    Last edited: Jan 27, 2022
    guycalledfrank likes this.
  28. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Hey,
    After reinstalling my OS, which of course reinstalled Unity and Bakery, I am getting out of memory errors.
    I am trying to bake for 3 days, with slightly different settings, but out of memory error appears. It is often around 58%.
    I have 1070 6gb Ti, and 128gb of ram, so it shouldn't be a problem.

    Out of memory.JPG Settings.JPG
     
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Weird! Both preview/bake never ignore backfaces. They're either interpreted as black or they scatter a fraction of front-face lighting when Backface GI is enabled. But they always block direct light. Only real-time lights shine through backfaces by default.

    Yeah, it's because there is technically no point in space to which we can compute a meaningful distance. But since specular color is taken from diffuse color, and if the attenuation is baked, it should affect specular as well.

    Hmm... the character is brighter overall. Is it using a reflection probe too?

    I think I tried it before, but didn't like it for some reason. But give it a try... I'm wondering if it gives better results in your case.

    Yeah... in older Unity versions Terrain was part of the core, so currently Bakery requires it.
    I'm a bit nervous making a package detection code (if for some reason it fails, it can empty existing terrain arrays), but I've just put everything terrain related under USE_TERRAINS define:

    upload_2022-2-1_19-40-45.png

    If you get the latest patch, you can remove this line from
    - ftLightmaps.cs
    - ftLightmapsStorage.cs
    - ftRenderLightmap.cs
    - ftBuildGraphics.cs

    ...aaand you should get a terrain-disabled version of Bakery.
    I'll look into automating it so you won't need to disable the defines manually, I'm just currently worried that such detection may not be 100% reliable.

    It does, thanks! So yeah, hole texture does indeed uses base texture resolution. And it's apparently incorrect :eek:
    For some reason I was thinking these two are connected, so I was just using a single RGBA texture for the base color + holes.

    Just fixed it. Hole texture resolution is now properly respected and is not dependent on base map size. You can patch it.

    It's a HDRP-only thing, I assume?
    TBH I don't understand its behaviour there. Increasing radius seems to darken the light. Wat? I would assume that it should just offset the start of the emission without changing intensity.
    Looking at specular it feels like HDRP's radius is just a roughness tweak. It doesn't give sharp spherical reflections from a light, instead it makes it blurrier and dimmer.
    So I'm not sure how I should match it. But I can force it to 0 when matching it to a baked light.
    Added it:

    upload_2022-2-1_20-43-13.png

    "Reflection" is derived from dominant light direction, which is turn derived from the SH. The SH is everywhere, as it's needed for diffuse as well. So no, it's not really possible, the data itself has no information about specular. But you can probably (ab)use shadowmasks and use them as specular masks instead.

    Latest patch has this mode where you basically bake the light completely (as in Full Lighting), but still get the shadowmask, so it might be useful for it:

    upload_2022-2-1_20-50-13.png


    I don't know how reinstalling the OS can affect available video memory. It's either some change in the scene/project or there is some new background program using VRAM.
     
    Last edited: Feb 1, 2022
    slakdevelopacc likes this.
  30. anden3

    anden3

    Joined:
    Nov 1, 2017
    Posts:
    2
    Hello! Big fan of this asset, but I have a few questions pertaining to the baking workflow.

    I am using Unity 2021.2.3f1 with Bakery 1.9, targeting the Oculus Quest 2.

    Should a scene contain an !ftraceLightMaps object or not? It seems to sometimes be generated, but from what I can see it is only meant for prefabs.

    Should the lighting data assets that gets generated inside BakeryLightmaps have their object names changed from `LightingData` to their actual filenames and their references reassigned to their respective scene, instead of _tempScene?




    And do you know why reflection probes often lose their baked texture when switching scenes, sometimes needing the textures to be removed and the probes to be rebaked several times before it sticks. Quite often it also creates new reflection probe texture, like -1, -2, -10 etc, and it complains about the reflection probe index being out of range.

    upload_2022-2-4_13-15-31.png
    upload_2022-2-4_13-15-36.png

    Thanks for your time!
     
    Last edited: Feb 4, 2022
    guycalledfrank likes this.
  31. AbdelNabut

    AbdelNabut

    Joined:
    Apr 2, 2020
    Posts:
    40
    Hi, I just used Bakery with Magic Light Map Switcher to bake lighting for 7 times of day, and the baking seems to have worked properly, but my tri count, batches, set pass calls, and shadow casters rose exponentially. And my framerate is down from 200FPS to 20FPS. Is this to be expected?
     
  32. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    dynamic and static objects with LODGroup doesn't cast shadows, but others are ok, I'm using HDRP

    upload_2022-2-7_16-23-47.png

    LODs.png

    LODs resieves shadows but not casts
     
    Last edited: Feb 7, 2022
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Yes, it's always there, it's just hidden (hideFlags = HideFlags.HideInHierarchy). This object actually contains necessary data to apply the lightmaps to corresponding renderers.
    Lightmapped Prefabs have a similar visible object attached to them.

    That's funny, I never saw this error in previous (e.g. 2021.1) versions and 2021.2 is currently broken in general, so I can't test it.
    Lighting data asset is a major PITA, as it can only be written very indirectly. Bakery only generates it for light/reflection probes.
    Sometimes old asset cannot be modified, because it's locked by Unity for some reason, and Bakery can swap between differently named assets. Previously, asset name had no influence. Maybe it's still the case and the warning doesn't matter?

    This is something I also heard only from recent Unity versions. For now I was not able to reproduce it. Highest Unity version I can currently run without immediate crashing is 2021.1.23. If you can reproduce any reflection probe weirdness there or on older versions, I'll check it! For newer versions, I'm waiting for this:

    upload_2022-2-8_19-6-47.png

    I don't think so. Sounds like you have some real-time lights with real-time shadows multiplying the draw calls? Since I didn't write MLS, I can't say anything about it, so please check if anything like this happens in a Bakery-only (single time of day) scene.

    Are you on the stock v1.9 or using the github patches? A similar issue was logged on github recently:

    upload_2022-2-8_19-11-6.png


    Personally I can't reproduce it on either version:




    Can you send me some little test project/package? Would really love to fix this, but can't repro for now.
     
  34. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    upload_2022-2-9_1-37-13.png
    HDRP project on 2019.4.28f1. yep, it's patched bakery. Have added a pot to the LODGroup. Setuped everything else to shadowmask example. After baking it's no shadows.

    the link will be avilible for 6 days - https://fex.net/ru/s/nrymobt
     
    guycalledfrank likes this.
  35. ualogic

    ualogic

    Joined:
    Oct 15, 2018
    Posts:
    16
    Hi, having black and white lines that come from the boundaries on the lightmap islands. Probably a newbie question, but how do I tackle these?

    P.S. Baking at 80 texels, max bounces max samples.
     

    Attached Files:

    • white.png
      white.png
      File size:
      121.9 KB
      Views:
      284
    • black.png
      black.png
      File size:
      75.1 KB
      Views:
      308
    • lm.png
      lm.png
      File size:
      287.7 KB
      Views:
      345
    guycalledfrank likes this.
  36. ClaudeLiet

    ClaudeLiet

    Joined:
    Jan 5, 2017
    Posts:
    2
    Hello, Bakery gets stuck at 55%, I found that the shader is missing, there's only "Hidden/ftCubemap2Strip" without "Export". If I delete "Export" it will be fine, but the shadow color in lightmap is strange purple. How to solve it? Thanks.

    upload_2022-2-11_11-8-30.png
     
  37. ualogic

    ualogic

    Joined:
    Oct 15, 2018
    Posts:
    16
    I also get blue, or purple without any missing shaders, but in lit areas with optix denoiser. I believe it comes from negative intensity values of yelowish light? Does not happen wihout denoiser, or with intel one.
     
  38. r_chevallier

    r_chevallier

    Joined:
    Apr 20, 2014
    Posts:
    31
    Just installed RTPreview and get errors in the ftPreview script


    'BakeryPointLight' does not contain a definition for 'directionMode' and no accessible extension method 'directionMode' accepting a first argument of type 'BakeryPointLight' could be found (are you missing a using directive or an assembly reference?)

    'BakeryPointLight' does not contain a definition for 'Direction'

    'ftRenderLightmap' does not contain a definition for 'restoreFromGlobalSector'

    'ftRenderLightmap.userCanceled' is inaccessible due to its protection level

    'ftRenderLightmap.TestSystemSpecs()' is inaccessible due to its protection level

    'ftRenderLightmap' does not contain a definition for 'fullSectorRender'

    'ftRenderLightmap' does not contain a definition for 'curSector'

    Thanks,
    Raymond
     

    Attached Files:

    Last edited: Feb 11, 2022
  39. ClaudeLiet

    ClaudeLiet

    Joined:
    Jan 5, 2017
    Posts:
    2
    I solved the issue, change API from opengles to dx11
     
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Thanks, tested it, found the related change, fixed it. Can you try updating again?

    Hmm looks annoying indeed. Is the ceiling a double-sided polygon by any chance? Is there any thickness to it or is there another floor just above the polygon?

    Yes, this shader is only used when Editor is in non-DX11 mode. But the file is present in the store package, as well as in the github repository, so I'm not sure why it's not in your project.

    Are you using OptiX 7? There was an issue like this related to my color processing, but I've fixed it, so please try the latest patch. Alternatively try any other denoiser, especially OpenImageDenoise, as it's the safest bet (behaviour doesn't depend on the driver).

    It looks like your lightmapper version is a bit too old for this RTPreview version. Please try updating the lightmapper as well. Latest store packages are compatible with each other.
     
  41. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,912
    Small but annoying thing seemed to have started this morning for me. After a lightmap bake, the lightmap texture is saved into the appropriate folder, but it's texture type is always Default, not Lightmap. This seems to have occurred after I set the Android project settings to Lightmap Encoding -> High. Is this a known issue or something I'm just overlooking in my settings? I'm using 2021.2.6f1 and the latest patched Bakery.
     
    Last edited: Feb 15, 2022
  42. ualogic

    ualogic

    Joined:
    Oct 15, 2018
    Posts:
    16
    Yes, it happened on Optix7 and I only tried it to see if the denoiser was the problem, with Intel it does not happen. Also, checked out the latest patch and it works. No more purple light.

    For white lines it is single sided with only sky behind, for black lines there are thick walls (pic black2) and single sided walls (pic black3)

    Attaching lightmap analysis for the black line you see in black3 as it was very easy to find and see what is happening there.
     

    Attached Files:

    Last edited: Feb 15, 2022
    guycalledfrank likes this.
  43. ronJohnJr

    ronJohnJr

    Joined:
    Mar 5, 2015
    Posts:
    106
    How come when the bake is finished, it doesnt apply anything to my scene? I move the light and no shadows are baked....
     
  44. r_chevallier

    r_chevallier

    Joined:
    Apr 20, 2014
    Posts:
    31
    Regarding RTPreview errors in the ftPreview script.

    I am using the latest version of Bakery according to package manager.

    Unity 2020.3.27f1
    Bakery 1.9
     
  45. makidrone

    makidrone

    Joined:
    Apr 23, 2018
    Posts:
    2
    I've been looking into ways I could bake my scenes on my Mac whilst using Unity 2019 LTS. The progressive baker just doesn't work as well as Bakery, however bakery doesn't work on Mac. I read up about networked baking and set it up on my Nvidia Windows machine as a server, but Bakery still returns lots of errors when trying to do a networked bake. It would be wonderful if this worked, potentially saving lots of time for Mac and Linux users. Right now I'm jumping back and forth between the two and it's really no fun. I'm a bit frustrated trying to find a solution. Thanks
     
  46. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    EDIT: Original message below - however I turned OFF "allow rotation" (a Dungen setting when laying out room prefabs) for the prefabs I had trouble with. Lighting looks good now. What do I need to do to ensure that Bakery is rotating the volume to match the prefab AFTER Dungen has laid out the level? I thought that the "mb.SetMatrix("_VolumeMatrix", vol.GetMatrix());" in BakeryVolumeTrigger.Awake() (on each prefab) would fix that?

    ---

    I'm using Bakery v1.9 with Dungen to lightmap prefabs and trying to use Bakery Volumes to get better lighting on the players (the only dynamic objects). The components are:

    - BakeryVolume (with "support rotation after bake" checked) and BakeryVolumeTrigger on each prefab.
    - BakeryVolumeReceiver on player.
    - All player shaders updated to use BakeryURPVolumeGraphRotatable shader.
    - I Baked lighting on each prefab (hopefully the standard settings are ok here?).
    - Dungen allows prefabs to be rotated during setup.

    When I play, the starting prefab at (0,0,0) fires the BakeryVolumeTrigger event and is lit correctly (player moves in/out of shadow, etc). When I run to the next prefab, triggers fire but the lighting looks wrong.

    Maybe the cause is:
    1) The Volume texture generates 3 files: RoomPrefabX_BakeryVolume0/1/2 but in the inspector file 0 doesn't represent the actual lights I have (large dark blob where my brightest light is). Files 1 & 2 look more accurate. The BakeryVolumeScript says its using "Baked texture: RoomPrefab_BakeryVolume0". Not sure how to interpret these textures (manual does mention L0/L1 RGB values, etc).
    2) Do I need to enable "BakeryVolumeTrigger.Movable" because the prefab isn't at 0,0,0?
    3) Should my lights be set to Mixed or Baked? i.e. is all lighting data coming from the Volume texture now?

    Thanks!
     
    Last edited: Feb 20, 2022
  47. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,657
    Other than using network baking, there's not much you can do (except for doing your work on your Windows machine instead). Bakery needs a NVIDIA GPU as it's based on OptiX (which is based on CUDA). Macs don't support CUDA anymore.

    What errors do you get when you do network baking?
     
  48. jmacgill

    jmacgill

    Joined:
    Jun 17, 2014
    Posts:
    17
    Just started collaborating with someone for a gamejam and they don't have bakery. For the life of me I can't work out how to get my bakes to them in a way that they can use.

    I've added the ftX.cs files listed at the top of this thread and in the manual to our shared repository but I can't figure how to get the lightmaps to show up on his build.
     
  49. VirtualDestructor

    VirtualDestructor

    Joined:
    May 3, 2014
    Posts:
    40
    I'm using the bakery sectors feature, and it is working great for the most part. I am having one issue though, when I try to render light probes I get an error message saying "Scene geometry/layout changed since last full bake. Use Render button instead."

    If I use the "Render" button to render the entire scene without a sector specified, then I do not get this error message. So it appears that there is no way for me to bake the scene one sector at a time and render light probes. Is that right?

    Ideally I would be able to bake the lightmaps and the light probes for a single sector at the same time.
     
  50. dhruv_unity154

    dhruv_unity154

    Joined:
    Feb 11, 2022
    Posts:
    14
    Hello All,

    I am thinking to use the Bakery for my VR Projects. But have a few questions.
    Bakery plugin has a requirement of a Windows PC for bake, I understood.
    Current project development I need to do Mac system also. Can I use the windows system for bake environments and Prefabs? After the baking process can switch to my Mac system for further Development with the Bakery plugin and all baked scenes?

    @guycalledfrank
     
    Last edited: Feb 22, 2022