Search Unity

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

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

  1. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Hi eveybody, has anybody achieved fetching the latest lightmaps from a remote machine (server) via synchronous script. I would love to integrate it in my buildsystem but seems like to be a bit hard to get all lightmaps from the baking server.
    I do get some strange errors here and there:

    The draft looks like the following but I do get Unity GUI Errors (wtf) and the maps aren't loaded:

    also what does this line exactly do?
    storage.serverGetFileList;

    Code (CSharp):
    1.    
    2. private static IEnumerator LoadDataFromServer(string ipAddress, Action done)
    3.         {
    4.  
    5.             var storageGO = ftLightmaps.FindInScene("!ftraceLightmaps", EditorSceneManager.GetActiveScene());
    6.             if (storageGO == null)
    7.             {
    8.                 Log.Warning(Tag, "Unable to find storageGO");
    9.                 yield break;
    10.             }
    11.             var storage = storageGO.GetComponent<ftLightmapsStorage>();
    12.             if (storage == null)
    13.             {
    14.                 Log.Warning(Tag, "Unable to find storage");
    15.                 yield break;
    16.             }
    17.             var list = storage.serverGetFileList;
    18.             if (list == null)
    19.             {
    20.                 Log.Warning(Tag, "Lightmapping list is empty");
    21.                 yield break;
    22.             }
    23.  
    24.             Log.Debug(Tag, "Starting downloading lightmaps for", string.Join(", ", list));
    25.  
    26.  
    27.             yield return null;
    28.             ftClient.serverAddress = ipAddress;
    29.             ftClient.ConnectToServer();
    30.  
    31.             if (!ftClient.connectedToServer)
    32.             {
    33.                 Log.Warning(Tag, "Unable to connect to server", ipAddress);
    34.                 yield break;
    35.             }
    36.  
    37.             ftClient.ServerGetData(list);
    38.             while (ftClient.serverGetDataMode)
    39.             {
    40.                 ftClient.Update();
    41.                 yield return null;
    42.             }
    43.             Log.Debug(Tag, "done");
    44.             done.Invoke();
    45.         }
    46.  
    Output:
    Seems like serverGetFileList returns an empty array



    Thanks in advance

    Am I wrong that:
    - Only Get Data is supposed to work when the client is also rendering it in the same session?
    So a buildSetup/buildClient which should only fetch the lightmapps triggered by another client isn't supposed to work?
     
    Last edited: Aug 17, 2021
  2. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    Ok I came up with a solution, seems to work but any input is very welcome:
    Code (CSharp):
    1.   public class BakeryLightmapWrapper
    2.     {
    3.         private const string Tag = "BakeryLightmapWrapper";
    4.  
    5.         public static RenderPcIp AndiLocalPcIp = new RenderPcIp("192.XX");
    6.  
    7.         private static bool _running = true;
    8.  
    9.         public static void LoadLightmapsFromRemoteServer(RenderPcIp ip)
    10.         {
    11.             //we need to close the editor window so the update/IEnumerator.MoveNext of the ftClient is only called once in a frame
    12.             ftRenderLightmap.instance?.Close();
    13.  
    14.             _running = true;
    15.             var coroutine = EditorCoroutineUtility.StartCoroutineOwnerless(LoadDataFromServer(ip.Value,
    16.                 (success) => { _running = false; }));
    17.             var coroutineUpdate = EditorCoroutineUtility.StartCoroutineOwnerless(UpdateFtClient());
    18.         }
    19.  
    20.         /// <summary>
    21.         /// make sure the update routine is called as long as we operate
    22.         /// </summary>
    23.         /// <returns></returns>
    24.         private static IEnumerator UpdateFtClient()
    25.         {
    26.             while (_running)
    27.             {
    28.                 ftClient.Update();
    29.                 yield return null;
    30.             }
    31.         }
    32.  
    33.         private static IEnumerator LoadDataFromServer(string ipAddress, Action<bool> doneSuccessfully)
    34.         {
    35.             ftClient.serverAddress = ipAddress;
    36.             ftClient.ConnectToServer();
    37.  
    38.             if (!ftClient.connectedToServer)
    39.             {
    40.                 Log.Warning(Tag, "unable to connect to server", ipAddress);
    41.                 doneSuccessfully.Invoke(false);
    42.                 yield break;
    43.             }
    44.             Log.Debug(Tag, "done connecting");
    45.  
    46.             var storageGO = ftLightmaps.FindInScene("!ftraceLightmaps", EditorSceneManager.GetActiveScene());
    47.             if (storageGO == null)
    48.             {
    49.                 Log.Warning(Tag, "Unable to find storageGO");
    50.                 doneSuccessfully.Invoke(false);
    51.                 yield break;
    52.             }
    53.  
    54.             var storage = storageGO.GetComponent<ftLightmapsStorage>();
    55.             if (storage == null)
    56.             {
    57.                 Log.Warning(Tag, "Unable to find storage");
    58.                 doneSuccessfully.Invoke(false);
    59.                 yield break;
    60.             }
    61.  
    62.             var list = storage.serverGetFileList;
    63.             if (list == null)
    64.             {
    65.                 Log.Warning(Tag, "Lightmapping list is empty");
    66.                 doneSuccessfully.Invoke(false);
    67.                 yield break;
    68.             }
    69.  
    70.             Log.Debug(Tag, "Starting downloading lightmaps for", string.Join(", ", list));
    71.  
    72.             ftClient.ServerGetData(list);
    73.             yield return null;
    74.  
    75.             Log.Debug(Tag, "ftClient after getData ftClient.serverGetDataMode", ftClient.serverGetDataMode);
    76.             Log.Debug(Tag, "ftClient after getData ftClient.lastServerMsg", ftClient.lastServerMsg);
    77.  
    78.             var waiter = new WaitForWithTimeout(30, () => !ftClient.serverGetDataMode);
    79.             yield return waiter;
    80.             if (waiter.Result == WaitForWithTimeout.WaitingResult.TimeOut)
    81.             {
    82.                 Log.Warning(Tag, "timeout getting data");
    83.             }
    84.             yield return null;
    85.             Log.Debug(Tag, "loading done");
    86.             doneSuccessfully.Invoke(true);
    87.         }
    88.  
    89.         public class RenderPcIp
    90.         {
    91.             public readonly string Value;
    92.  
    93.             public RenderPcIp(string value)
    94.             {
    95.                 Value = value;
    96.             }
    97.         }
    98.     }
     
    guycalledfrank likes this.
  3. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    460
    Hello,

    I am reporting 3 issues.

    1. Trying to clear all bakery data, including deleting its lightmaps, does not work. upload_2021-8-19_10-34-1.png
    The lightmaps simply remain in the project:
    upload_2021-8-19_10-34-13.png

    2. Secondly, and this is a bit tricky to explain. We had done several bakes with bakery. Then at some point we decided to do a bake with Unity lighting, and we did. We always bake multiple scenes at the same time. So we load the scenes and then bake. However, we had very weird artifacts.

    This is what it should look like and this is what it does look like right after the bake:

    However, if we unload the scene and reload it, there are many artifacts:

    Even after baking with the Unity lightmapper, the model is still using the Bakery lightmap. How can this be undone?

    3. I noticed another object that had similar artifacts. That object was set to static. I removed the static flag and re-baked with Unity lighting window again. Right after the bake, it looked again. But again, after reloading it looked bad. I was wondering why, because the object was no longer marked static and should've used light probes. But it didn't. I set the object back to static and in the inspector I could see that it is using a Bakery lightmap. So for some reason, even when the object is set to non-static, it keeps using the Bakery's lightmap.

    Thanks!
     
  4. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    77
    Hi,
    I'm having a sort of "compatibility" issue when using the "Bakery Lightmapped prefab" component from GPU Lightmapper and Bolt (Still Bolt in Unity 2020 LTS, in Unity 2021 is called Visual Scripting).
    The "Flow Machine" from Bolt works as expected, no units show error. The problem comes when I try to do the "baking" because the prefab connection is showing an error even when there are no pending changes to apply to the prefab.
    The name of my prefab is TriggerZoneA and it shows this error:

    Error: prefab contains unapplied data (TriggerZoneA._data._json)

    I don't even have a json component/object/script or anything related to that.

    upload_2021-8-19_2-12-2.png

    At this point the Bolt's Flow Machine has the following (it is executing a custom event, that disables the "Detect Enemy" component after 2 seconds):
    upload_2021-8-19_2-15-49.png

    If I modify that custom event, removing the "Wait" unit, to have it just like this:
    upload_2021-8-19_2-16-14.png

    Then the error is gone and the prefab shows that it is OK and ready to do the baking:
    upload_2021-8-19_2-16-57.png

    If I add back the "Wait" unit to the Flow Machine and I add anything after that unit, in this case a message, it shows the error again. Basically, any event with a "Wait" unit in Bolt, makes the Bakery Lightmapped Prefab component unable to work.

    I can try to move those events another prefab that is not baked but some units are kinda big and there are a lot of prefabs. It would be tricky to test everything again when everything is already working without any changes. The only thing left to do is the baking and I decided to leave it to the end because I thought there was not gonna be any problems :(

    Is there a way to make Bolt (and its wait unit) to work with that component to bake lightmap to prefabs?

    Thanks.
     

    Attached Files:

  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Note that on top of the padding there is also block alignment which is enabled by default in xatlas. It tries to align charts to 4x4 block boundaries to improve quality after texture compression. You can try disabling it, it's the last argument (set to "true") in xatlasPack() call inside ftBuildGraphics.cs, but I would leave it.

    ...and on top of that apparently checker preview just had uv*0.5 for some reason, which is the reason for the "half-texel", which was only visible there, but not in the actual lightmap.

    ...and on top of that there was some error in area->resolution calculation.

    I've fixed those and made block alignment an option:

    upload_2021-8-19_23-24-53.png

    upload_2021-8-19_23-25-0.png

    Bakery does 16 passes of dilation. Does it repeat the color to some distance at least? I limited it there because I thought that having more than 16 texels of padding alone would be weird, wouldn't it?...

    What is your setup here? Two different scenes, each with a lightmapped prefab, second is loaded additively? Or is it just two scenes without the lightmapped prefabs?
    In any case, the assets are loaded once, so there shouldn't be a memory problem.

    No.

    No.

    Put a single 4096x4096 lightmap group on root objects of your scene: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector

    I also recommend using Hole Filling for a tighter atlas: https://geom.io/bakery/wiki/index.php?title=Manual#Hole_filling

    It should actually improve shading on lowpoly objects, unless their normals differ from the triangle shape WAY too much.

    Without smooth positions:



    With smooth positions:




    But it can fail on extremely low-poly objects with smooth normals, e.g. a box with sphere normals..

    See https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_jagged_shadows

    Not exactly, as the binary part is in compiled form and it's designed for what it does. You can try abusing RTPreview to render something raytraced inside the game, but it's also NV-only...

    OptiX is pretty fast, it's no slower than e.g. DXR. It's just slower to pass huge-sized lightmaps around and trace them with large amounts of rays comparing to screen-sized 1spp rendering and various cheats that current ray-traced games use in real-time.

    Can happen if your wall is a double-sided polygon. This way Bakery doesn't know where the real visible floor is and where to fix the darkness. Make sure the wall is not double-sided.
    Also make sure that Adjust Sample Positions is enabled.

    At this point, the best option to try is
    - Update via the patcher: https://geom.io/bakery/wiki/index.php?title=Github_access#v1.9.2B_patching_instructions
    - Enable "Alternative scale in lightmap" in Project Settings
    - Make sure your atlas packer is set to xatlas
    - See if it produces better results without doing anything else
    - If you want to tweak further, use "scale in lightmap" on your mesh renderers.
    (or just try the last line without anything above it)

    Bakery/Standard is for the standard rendering pipeline. For URP, use the graphs, they're included as Bakery_ShaderGraphURP.unitypackage. The latest version is always downloadable here: https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper

    (without enabling "alternative scale in lightmap" it should still work like it always did, for backwards compatibility)

    You simply don't have any ambient light in the baked scene. You can:
    a) Use Skylight and make it bright enough to pass through windows or other openings: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Sky_Light
    b) Create a fake "ambient" light out of shadowless directional lights: https://geom.io/bakery/wiki/index.php?title=How_do_I...#How_do_I_add_fake_ambient_lighting.3F
     
    Last edited: Aug 19, 2021
    Noors84 likes this.
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    This list is populated with filenames that should be sent to the server after the scene is fully exported. It is then cleared.

    Do you want to do something similar to the "Get data" button, but in your own script, which is not a coroutine?
    Seems like it worked in the end?

    It only deletes the files referenced by the current scene. It doesn't access other scenes' references and it doesn't know otherwise which assets were once generated by Bakery. So if you didn't use this option from the start, it is possible there are some abandoned lightmaps left, not referenced by anything. As output folder can be set differently for every scene, there is no way to tell unreferenced lightmaps from other assets.

    With the same Bakery->Utilities->Clear baked data (Clearing "Baked data references" is enough). Without clearing, it'll override Unity bakes.

    Yeah it seems to be an issue with multiple third-party assets.
    Just added this option:

    upload_2021-8-19_23-59-28.png

    Can you try updating via the patcher?
     
  7. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    973
    This is the same lightmapped scene; once in one project before export to asset bundles, then in the other (or the same) project after importing from asset bundles.
    Before export to asset bundles:
    original.png
    After import from asset bundles:
    imported.png
    I don't think Bakery is to blame, but just can't figure what's going on and why these maps are doubling.
     
  8. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Yes it does, but not all the way. There is still empty space between UVs.
    Could you put a setting in the preferences to set the number of passes we need? That would be neat! :p
    Well, it depends on the amount of padding and the amount of downsampling you need.

    I'll check this out, thanks :)

    I didn't mean to disrespect the Nvidia geniuses that made Optix :p
     
    guycalledfrank likes this.
  9. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello,

    I just bought this asset and I was wondering... Can you uninstall or deleted Bakery once the lightmapping is done? In other words, do you need to Bakery in the build?

    Regards,
    Carlos
     
  10. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    guycalledfrank likes this.
  11. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Thank you atomicjoe!

    Regards,
    Carlos
     
  12. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello atomicjoe,

    I read everything in the link you gave me yesterday but it was not very clear if that is what my situation is. We are building for Web GL. I have to upload the project to GIT. What I need is to only use your asset to create the light map textures in my Unity and then delete everything but what is needed in order to run the application with the light mapping created by your Bakery(which by the way is amazing!). So could you tell me what are the files that must be present in the project in order to achieve this?

    Regards,
    Carlos
     
  13. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I'm not the author of Bakery, just a friendly user ;)

    As stated in the FAQ, this are the scripts that need to be present:
    So you can remove all the rest that Bakery installs. Leave just this files up there.

    https://geom.io/bakery/wiki/index.p...2Fother_version_control_system_with_Bakery.3F
     
    guycalledfrank likes this.
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    guycalledfrank likes this.
  15. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Well! You are surely a very friendly user and I appreciate you very much! Thank you.

    Regards,
    Carlos
     
    guycalledfrank and atomicjoe like this.
  16. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    I am having trouble when I upload to git. The project looks great inside unity in my pc but when upload it to git and open the WEBGL application the light map has totally wrong UVs they don't match with the meshes! Is there a specific file that controls the correct UVs placement for the light maps that needs to be uploaded with the project?

    Regards,
    Carlos
     
  17. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hey. Thanks a lot for the update on alternative lightmap scale. It seems pretty consistant with Unity now. I shall test it deeper next week.

    Yes i've read that. But basically it is blurriness, and not the quality of supersampled AA. I don't know if it could even be implemented but it would be an area of improvment imo.(and i'm using SRP's so no bicubic filtering)
     
    guycalledfrank likes this.
  18. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    When baking the lightmaps with Bakery, set it to "remove UV adjustments", otherwise you will have problems when opening the project on other computers via GIT.
     
  19. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi.
    Could you give me some information about this change?

    1.JPG

    Do i need to udate my Bakery generated Skybox Probes i use in the Bakery Skylight in HDRP?
     
  20. orzech123

    orzech123

    Joined:
    Mar 12, 2018
    Posts:
    17
    I focused on a) option and that's the result (not good):
    upload_2021-8-23_16-41-29.png

    Currently I am trying to make it looking good so Color of Skylight CAN be bright. But later I want night scene so the ambient light will need to be darker) Also removed ceil so the sky light is iluminating the interior but in the end I want no windows etc. and have it looking good...

    Any suggestions to make it look fine with baked lightmaps?

    EDIT:
    I replaced point lights with area light and used settings like in this tutorial:

    And the result is not much diffrent than earlier (when zoom in I can see no shadow casting on other surfaces by all the stuff on the table, it's just flat and one color):
    upload_2021-8-23_17-9-8.png

    I can't wait for having Bakery configuration knowledge enough to generate good looking sceens like in your screenshots guys! :)
     
    Last edited: Aug 23, 2021
  21. AHFontaine

    AHFontaine

    Joined:
    Aug 3, 2017
    Posts:
    19
    Seems like the latest Nvidia Driver (471.68) broke the Optix Denoisers. (on 3090)
    Seems to be fine with the Open Image Denoiser though but it's a tad annoying.
    Saw that other people on the Discord have the same issue.
     
  22. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    A fix is on the way.
     
  23. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Can I use git version control system without having Bakery in the machine that build the project? Because in the Q/A documentation says to make sure both machines have the same version of Unity and Bakery.

    I am the only one that create the lightmapping in my machine, then the server machine builds the actually project.

    Regards,
    Carlos
     
    Last edited: Aug 25, 2021
  24. garrido86

    garrido86

    Joined:
    Dec 17, 2013
    Posts:
    233
    I have a quick question, can I also use Bakery on individual Modells/Prefabs independently from the Scene (this is a hindrance and limitation with Unity's own lightmapper solution)?
     
  25. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    guycalledfrank and garrido86 like this.
  26. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937


    Hi,

    My last hope was to use Bakery Volumes.
    So i tried to use the Better Lit with Volumes to render my dynamic objects.
    But there is the same problem as with Leagacy and L1 probes in Shadowmask. (see post before)

    Dynamic capsules have this tanline.




    Bakery Better Lit Volumes Shadowmask 1

    Volume_BetterLit.JPG

    Bskery Better Lit Volumes Shadowmask 2

    Volume_BetterLit2.JPG
     
    Last edited: Aug 30, 2021
    guycalledfrank likes this.
  27. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello !

    After quickly trying Bakery in a test project to get the hang of it, I tried to apply it to one of my scenes, but it was a disaster :

    During the the baking process I got this window :



    Then, after the bake is cancelled, console is continuously spammed by those


    And those


    I have an RTX 2060 Super, and the scene should be fairly manageable, with around 40 maps to bake.

    Thank you,

    Vincent.

    EDIT : Oh yeah also, I can't add my github account to get latest patches... I get "This invoice is already registered with another user". I just got Bakery today
     
    Last edited: Aug 26, 2021
  28. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Are occlusion probes working for anyone ?
    Unity lightmapper just endlessly bakes nothing.
    Unity 2020.3.2
    Thanks !
     
  29. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
  30. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hi thank you for your reply !

    I have read that but it didn't help much : I'm already using terrain optimisation, I have low texel density (10/unity, with most of my assets' lightmap scale at 0.2), and Bakery's estimated memory needed is 135MB which should be WELL below what my card can stand. Just tried it again disabling even more objects, and I get the same issue (without the endless console spamming though)

    Console says "Error: Unknown error. See .ftracelog.txt for details. (1)", but I can't find it.
     
  31. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Try using the CPU denoiser instead of Optix and disabling "memory optimisation" in advanced options in Bakery.
    Also, it can be a GPU timeout. Let me find the revelevant link to that...
     
  32. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
  33. garrido86

    garrido86

    Joined:
    Dec 17, 2013
    Posts:
    233
    Does anyone have experience or knows if Bakery works on macOS when having a external nvidia GPU connected? I suppose it won't work since Bakery uses win32 nvidia libraries but who knows.
     
  34. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Exactly. No Mac support at all.
     
  35. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello I am re-posting this since I didn't get any answer:

    Can I use git version control system without having Bakery in the machine that build the project? Because in the Q/A documentation says to make sure both machines have the same version of Unity and Bakery.

    I am the only one that create the lightmapping in my machine, then the server machine builds the actually project.

    Regards,
    Carlos
     
  36. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    As long as the build machine has the necessary scripts and lightmaps, then yes.
     
  37. virtualjay

    virtualjay

    Joined:
    Aug 4, 2020
    Posts:
    68
    I'm running into a bit of an issue using the suggested method of calling ftRenderLightmap.RenderButton() to automate baking. The code in ftLightmap's OnGUI look like:

    if (GUI.Button(new Rect(10, y, 230, 30), "Render"))
    {
    ValidateOutputPath();
    RenderButton();
    }


    When you just call RenderButton(), ValidateOutputPath (a private method) is never called. ValidateOutputPath is the only place where outputPathFull is set. If outputPathFull isn't set, you'll wind up with lightmaps being put in your main Assets folder instead of in the subfolder you specify, which isn't great.

    It would be better if ValidateOutputPath() was removed from that call above and added at the start of RenderButton.
     
  38. garrido86

    garrido86

    Joined:
    Dec 17, 2013
    Posts:
    233
    I just bought the RT Preview for my 3D Artist who is using a RTX2080 but the preview keeps crashing. Any idea why that is and how it can be made more stable?
     
  39. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Try this:
    https://substance3d.adobe.com/docum...th-long-computations-tdr-crash-128745489.html

    Even if it's not the cause in your particular case, increasing the TDR to 60 seconds is always useful for development and will not hurt anyways.
     
    guycalledfrank and garrido86 like this.
  40. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hi, I think unchecking "Generate smooth positions" crashes bakery.
    Latest patch.
    I have this error :
    FileNotFoundException: C:\Users\team\AppData\Local\Temp\frender/uvpos_blablabla_LM0.lz4 does not exist
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    ftBuildGraphics+<ExportScene>d__234.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:7987)
    ftRenderLightmap+<RenderLightmapFunc>d__284.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:5306)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4637)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <d6a6a4b561b9431dbfe2c61f7bf0d405>:0)
     
    guycalledfrank likes this.
  41. robert-nally

    robert-nally

    Joined:
    Mar 5, 2014
    Posts:
    76
    I'm using a 3070 graphics card and I believe I may be running into the issue with the latest NVidia drivers causing a crash (error message attached).

    I saw that a fix was coming. Any idea when that might be? I know on Nvidia's end that will probably take months. Should I try downgrading the driver or will a Bakery update be incoming soon?

    FWIW, this engine is sad without this plugin.
     

    Attached Files:

  42. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Update to latest version using the built-in updater: a workaround of the Optix denoiser has been implemented.
    If it's not related to the denoiser (or happens even with the CPU denoiser) try this, it will not hurt:
    https://substance3d.adobe.com/docum...th-long-computations-tdr-crash-128745489.html
     
  43. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    I think there are some places where I have 16 hardcoded, but not everywhere. Can you try
    - Getting the latest patch
    - Opening ftRenderLightmap.cs
    - Finding
    public int dilate = 16;

    - Increasing the value
    - Checking if it works in your case?
    If it does, I'll just move it to project settings.

    And you're really helpful! :)

    I assume you need to sync it with another machine that builds to WebGL? Perhaps something here will help? https://geom.io/bakery/wiki/index.p...2Fother_version_control_system_with_Bakery.3F
    ...or just use Remove Adjustments, as atomicjoe suggests, as it makes everything simpler.

    Also just found and fixed a bug where very small objects would collapse to 0 texels when using alt. scale. Should work well now.

    Yeah, supersampling shadows could help in cases when penumbra is narrow and no bicubic is used.
    Technically you can try just rendering in higher resolution and then downsampling the lightmap? But simply applying supersampling to shadows alone would be much faster.

    Actually it's not that hard to add.

    Actually, just added it:

    You can now update via the patcher and try "Anti-alias" option on the directional light (only there for now).
    The amount of supersampling is currently hard-coded. Let's see if it works.

    upload_2021-9-1_19-12-9.png

    upload_2021-9-1_19-12-59.png

    upload_2021-9-1_19-13-44.png

    No, skybox probes are unaffected. But apparently cubemap cookies and HDRIs had their bottom face somewhat flipped before. Since often HDRIs don't have too much interesting information in the bottom face, it was very hard to notice... until someone tried using a very specific cubemap cookie.

    Yes, your table looks like it doesn't have any lightmaps. Is it marked static ("contribute GI")? Does it have lightmapping UVs? How does it look with Checker Preview (maybe texel density is too low)?
    There is a good guide written by Silent, maybe it'll help you to get the basics right: https://gitlab.com/s-ilent/SCSS/-/wikis/Other/Light-Baking

    Yeah. NV admitted there is a bug:

    upload_2021-9-1_19-20-20.png

    Try using the latest github patch. It splits denoising jobs into smaller tiles as a workaround.

    Yes, only the scripts atomicjoe mentioned are needed on the build machine.

    I'm not sure how to fix it. I think only Jason has enough knowledge of
    - HDRP inner workings
    - His own shader system
    to fix this.

    (answering you on Twitter)

    Hmm I can't reproduce it on this version with both legacy/L1, at least seems to work on the example scene:

    upload_2021-9-1_19-33-45.png

    Does it work on the example scene? Maybe it just takes longer on your scene due to its complexity?
    Also consider using BakeryVolumes, if possible, as these provide a similar occlusion mechanism, but are not bound to any built-in Unity systems.

    Yeah, as you noticed, it's currently Win-only.

    Yeah, I noticed this issue and changed the code already. If you try the latest patch, RenderButton() now calls ValidateOutputPath().

    Any info about the crash? E.g. visible error messages, content of .ftracelog.txt after the crash?

    Hmmm. Yes. Fixed it. Try the really latest patch now?

    This one is related to running OptiX 5 on 3XXX, which is unsupported there. Make sure to enable RTX mode and don't use OptiX 5 denoiser.
     
    Noors84 and keeponshading like this.
  44. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    That's because I'm a Bakery fanboy :p
    WTF?? THANKS!!
    Now we need this on all other lights too!! :D
    No problem at all, I'll check this and let you know.
     
    keeponshading and guycalledfrank like this.
  45. garrido86

    garrido86

    Joined:
    Dec 17, 2013
    Posts:
    233
    The crashes went away after an half hour of use, if it is important I can ask the artist for the log file.
     
    guycalledfrank likes this.
  46. iLeetZero

    iLeetZero

    Joined:
    Jan 11, 2021
    Posts:
    3
    I might be wrong, but are the denoiser values hardcoded?
    I'm getting more desirable results with the default lightmapper with an aggressive denoising value than Bakery's rather blocky result.
    I already tried upping the samples and increasing the texel size to no avail. I prefer blurry "lower quality" shadows than blocky shadows, and even then there's simply room for fine tuning by changing the Radius value of OpenImageDenoise in the default lightmapper.
    Would be nice to have that as a slider if possible.
    upload_2021-9-2_1-23-53.png
     
  47. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    If it happens again, it would help.

    Blocky result is a result of low resolution sharp shadows, not noise. Increase Shadow Spread on the light to get blurrier shadows.
     
  48. iLeetZero

    iLeetZero

    Joined:
    Jan 11, 2021
    Posts:
    3
    It seems like there still is arbitrary blockiness not present in default Unity while losing quite a lot of thinner shadows by doing so, but I suppose it works, so thanks a lot! I still think a slider for the denoiser would be nice, though.
    That was one fast reply, by the way, cheers!

    Actually, kinda scratch that, I probably just don't know how to configure this properly, but I redid the test with Unity again and it still just seems like a very odd discrepancy in quality for a significant trade-off. To clarify, lower shadow spread still gives me the desired thin shadows. Raising it just dissipates them almost too much while retaining blockiness.

    upload_2021-9-2_1-46-35.png
     
    Last edited: Sep 1, 2021
  49. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    It would be really nice to have some kind of post process blur pass available for Bakery, as Unity's lightmapper has one.
     
  50. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Unity's lightmapper has an optional built-in post process pass to blur the whole lightmap. Bakery doesn't have that (yet?) so you can't just blur the whole lightmap like in your screenshot.
    The only options right now are the shadow spread option, which, as you know, it spreads with distance, and the shinny new antialiasing option for directional light shadows (latest update)


    Another option would be to render the lightmaps at a higher size than the actual output and downsize them, but this will not give you blurriness, it will give you better antialiasing in the shadows. (reducing the blockiness)
    Having an additional blur post process pass would be very cool though. ;)