Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi,

    1)
    When go into play mode or run build, bakery enabled any Light mapping setting from Unity. So environment lighting is turned of by Bakery.

    In Version: 1.65 it happen again. Did I miss any setting? Can I disable this behavior in any bakery script?
    I can't get any environment lightning on.

    2) Unfortunately denoise also came up with this error every time at AO rendering
    Untitled-1.jpg
    This happen in the previous version sometimes. But can absolutely not remember how to fix it.

    Thank you.
     
  2. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    113
    Hi, I tried the bakery standard shader, it seems it might be working even with addressable scene. will report back if I find anything not working.
     
    guycalledfrank likes this.
  3. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    Was there a fix in the end for the float spam issue?

    Code (CSharp):
    1. Float overflow
    2. UnityEngine.Debug:LogError(Object)
    3. ftBuildGraphics:exportVBTraceTexAttribs(List`1, List`1, Vector3[], Vector3[], Vector2[], Int32, Boolean) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:449)
    4. <ExportScene>c__Iterator0:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4739)
    5. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3877)
    6. ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3343)
    7. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ... other than commenting it out of the code itself?

    Also this constantly...

    Code (CSharp):
    1. Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuEventSynchronize( m_event ) returned (700): Illegal address)

    Also...

    Code (CSharp):
    1. Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuEventSynchronize( m_event ) returned (719): Launch failed)
    I legitimately cannot get a clean run now and have wasted several hours in the process. 2080Ti trying to use RTX mode on the latest drivers. Nothing more in the ftrace logs than the error in the popups that I've pasted here.
     
    Last edited: Nov 17, 2019
  4. Levr01

    Levr01

    Joined:
    Jun 6, 2017
    Posts:
    26
    Having acquired this asset, I was very disappointed. The second day I try to bake the light with it and it will come out every time different errors. The last time after a whole hour of rendering, this appeared on the screen - "Error 1282 memory allocation failure - (details: function "_rtContextLaunch2D" caught exception: Out of memory)"
     
  5. HeliosDoubleSix

    HeliosDoubleSix

    Joined:
    Jun 30, 2013
    Posts:
    148
    Have you tried Bakery settings: 'GI VRAM optimization' set to 'Force On' under: Settings 'Advanced' to avoid the crashing at least.
     
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Can't suggest anything better than "scale in lightmap" without being able to analyze the mesh/UVs. I also wonder if there is a diagonal UV line for this edge.

    I didn't use Mesh Baker, so don't know.

    Any more info on that? I can send you 1.6 privately, but it is also important to debug the crash or at least get some clues. Write me a PM.

    I'd say it's a bad idea to lightmap a forest. Forests are complex and dynamic.

    Environment lighting (skybox lightprobe) is always turned off on meshes where lightmaps are used. Unity does not allow them being used together (or maybe I misunderstood the question).

    The setting is now never enabled. Whatever was set in your Lighting window was kept.

    Denoiser was updated. Some older GPUs (e.g. GeForce 6xx) have problems with that. Try "Legacy denoiser" option in experimental settings.

    All errors combined look like there is something wrong with your scene (UVs or geometry). Make sure all static objects have correct lightmapping UVs. Maybe try baking only a part of your scene first.

    See this: https://geom.io/bakery/wiki/index.p..._get_an_.E2.80.9COut_of_memory.E2.80.9D_error

    Generally, always try it on a smaller scene first, so you get the idea of good settings to use.
    Using default 20 Texels Per Unit is not suitable for every scene.

    You can also ask for a refund or something.

    I bet it can be solved without even using this option.
     
    Last edited: Nov 19, 2019
  7. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    If I set GI bounces to 0 then it will complete. With it enabled, it seems to fail randomly each time (and on very rare occasions, will complete). All static objects have Unity set to generate their lightmap UVs. If I select everything in the scene and tell it to just do those groups, it'll complete (I assume as it's not actually doing GI in that instance).

    EDIT: Apparently not, it just seems to succeed more often that way.
     
    Last edited: Nov 19, 2019
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Right. That sounds like a typical memory limit.
    - What is your GPU?
    - How large is the scene?
    - What is your Texels Per Unit value?
    - Do you have lots of other 3D programs (or browsers running WebGL) in background?
     
  9. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    Have you ever had the issue where your computer hard crashes (just shuts off then restarts) when running bakery? It will run the built-in light mapper and I even did stress tests on the graphics card to make sure it wasn't a bad card. Seems really strange that it would cause that.
     
  10. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    2080 Ti (I did put that in the original post but it's easy to miss). TPU is set to the default 20. The scene is a landscape so it's quite large but not massive. Nothing else running in the background and definitely nothing 3D.

    Top-down view of the scene - https://cdn.discordapp.com/attachments/629302253768933376/646460751174696990/unknown.png
    Only the top right is populated and nothing too crazy. The Bakery memory utilisation guess at the start normally says it predicts less than 2GB of GPU usage, well below the card's available 11.6GB.

    Regarding the GPU, the other lightmappers are fine (albeit a lot slower). No issues with games or other software. It's Unity 2017.4.28f1 if that's relevant.
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    I didn't. Can be hardware/driver fault. Windows defaults to rebooting instead of BSOD if I'm not mistaken, but BSOD details can shed some light. Maybe try running eventvwr and see recorded system events.

    20 texels is good for a small alley, not a landscape. See recommendations here: https://geom.io/bakery/wiki/index.php?title=Manual#Texels_per_unit
    Start with 1-5, increase if needed (also selectively increase using Scale in Lightmap).

    Also: try enabling Terrain Optimization in advanced settings. This is critical for high-resolution heightmaps.
     
  12. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    RTX mode and Terrain Optimisation are mutually exclusive options. I'm using the RTX mode as it's much, MUCH faster than not using it.

    EDIT: Even setting the texel option to 1 results in the same random failure behaviour.
     
    Last edited: Nov 19, 2019
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    I see, that's the problem, it's not the texels. RTX can only trace triangles, and heightfield terrains produce a TON of them, so they can't fit in memory (Bakery doesn't know which parts of the terrai. Non-RTX mode supports mixed primitive types, and Bakery implements custom heightmap tracing algorithm to avoid using too much data. I originally added it to help IMGNATION bake their MonoWheels game where they had 4 2048x2048 terrains.
    The options are:
    a) Use terrain optimization and don't use RTX.
    b) Use lower resolution heightmaps.
    c) Don't even use a heightmap, use an optimized mesh instead, with more detail near the player and less in the distance.

    How much? 1.5 times? 10 times?
    1.5 - 2 can be expected; anything higher than that is suspicious. If higher difference is observable even with pure terrain+lights without any other objects, can you send it to me as unitypackage (without textures) for investigation/debugging?
     
    Last edited: Nov 20, 2019
  14. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    I wouldn't say the terrain is high resolution, but I'm new to all this, so here are the numbers for you to confirm if that's likely to be an issue - https://cdn.discordapp.com/attachments/629302253768933376/646689666950496257/unknown.png - I wouldn't have thought that was big enough to be an issue.

    Speed wise, it was taking roughly 9 seconds per % using RTX. It was taking many times longer than that without, but I'd rather not force a rebake now to test it because I'm not sure I'll be able to get it to complete again. I'll be sure to time it next time I do clear the lighting though.
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Yeah, 512 shouldn't be a problem, especially on 2080 Ti. Is there really nothing else but this terrain and a handful of objects? Even 9s per % sounds too much, even for non-RTX.
    Is it massively faster if you disable everything except the terrain (or does it fit in memory with RTX mode then)? Also, which lights do you use and with how many shadow samples? How many GI bounces and samples are used?
    Also wild guess, but did you try updating your video drivers?
     
  16. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    GI seems to be what takes the time. If I do "Render selected groups" (without actually selecting anything) it actually seems to bake all the lighting except for GI and only takes 36 seconds to do it. I'd not expect that to do anything given that I don't have any groups and nothing is selected, but it seems to do almost all the world lighting, sans what I guess is GI as it's missing that "ambience".

    The failure seems to happen regardless of bounces. Normally I do 5 bounces and 64 samples, but I've tried pretty much every combination and it still fails randomly 95% of the time.

    Drivers are the latest version (I updated a few days ago thinking that it could be driver related).

    To get a sense of scale and what's being baked, using the top-down picture before as a reference, this is looking from right to left, towards the pond - https://cdn.discordapp.com/attachments/361741445352259584/645299062328918037/unknown.png - so it's not "empty" but it's not exactly a densely packed landscape.
     
  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    The scene looks quite simple, I'm not sure what could be the problem here. 64 samples is quite a lot - for open scenes where sun/sky isn't too occluded, you can get away even with 8 without noticeable difference in quality. 2-3 bounces should also be sufficient. Also using 8-16 samples for skylight should be enough here.
    Does it fail/takes too long with terrain only? Just trying to make sure the problem is terrain-related and not caused by some obscure mesh.
     
  18. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    62
    Where can I get old versions of Bakery ? 1.65 is causing issues with subsurface and also the denoising error.

    (I did try githubb but it requested an invoice. I used my year old invoice when I first purchased and it said invalid.)
     
    Last edited: Nov 20, 2019
  19. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hi! long time nos posting here and i came across a problem realted with pipeline, here goes.

    Right now the game uses async load for the scenes of the game so we optimize everything that is loaded, but i realized something. All the lighting is done in one scene let call it "Lighting Scene" and the option split by scene is on, so each scene has their own set of lightmaps. Now, there is another scene called "Game Scene" which is the one that loads all the other scenes during game play, the problem is, that lighting does not match between the Lighting Scene and the Game Scene, and im not sure how the pipeline should work there, when scenes are lighted in one scene and used in another one.

    Right now the "Lighting scene" has the Skylight and the Main light, and all the other particular lights are in their respective scenes. The "Game Scene" has the same lights as the Lighting Scene but the result is different.. I'm not sure if there is a configuration file that need to be loaded in the Game scene or something like that.

    Right now i'm testing with Subtractive mode and Indirect mode.

    Thank you for the help.
     
  20. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    Roughly 4 seconds per percent in RTX mode. Terrain Optimised mode doesn't get anywhere, it gets stuck at 1% on "Adjusting sample points for (world)_LMA13". Disabling everything (including lights) except for the terrain completed very quickly, jumping up 10-30% at a time in both Optimised Terrain and RTX mode, probably around 40 seconds in total, if that.

    Idle GPU VRAM usage was 1.6GB. It went up to 2.1GB in RTX mode and 2.4GB in Terrain Optimised mode.

    123 seconds in RTX mode to do just the terrain but with the main world lighting enabled again. VRAM usage was around 2.0GB the whole time with a brief spike for less than a second around 5GB.

    373 seconds in RTX mode with the terrain, main world lighting and the camp + pond enabled. VRAM usage stayed around 1.7GB the whole time except for a spike just before the denoising process again.

    All the above tests were with 16 textels, 3 bounces, 32 samples. So memory doesn't seem to be a concern at all.

    Some mesh related issue still looks likely at this point I'd say given all the above results.

    EDIT: Did the entire map, minus the trees and it completed in RTX mode in 586 seconds. VRAM usage barely went above 1.6GB (0.7GB idle) so RAM *really* isn't an issue, nor does RTX mode appear to be having any issues with terrain at all. The issue must be with some of the tree meshes.
     
    Last edited: Nov 20, 2019
  21. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    See my answer above: https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-65-released.536008/page-73#post-5191247

    What exactly is different? UV mapping, colors? Any screenshots? Since you're in Subtractive, can it be related to scene "shadow color" in the lighting window?

    Sounds adequate. Since it is the terrain+camp+pond, which objects are left, the trees? Is there anything special about them? Alpha testing can slow down the tracing process, but not that much, and shouldn't pose any serious concern for memory.
     
  22. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    Did the entire map, minus just the trees and it completed in RTX mode in 586 seconds. VRAM usage barely went above 1.6GB (0.7GB when idle) so RAM *really* isn't an issue, nor does RTX mode appear to be having any issues with terrain at all. The issue must be with some of the tree meshes. Any way to narrow down which one or why?
     
  23. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    @guycalledfrank I’m going to try a bit of a different approach for Amplify, might be a nice educational experience too

    All I need to know, is what is actually stored in the RNM maps? I’ve shown them on surfaces as the emission output before and I can see they’re basically a lot of white and gray. If I wanted to get information from those maps though, what information would I actually be getting? Did you follow an existing approach that has a whitepaper or something that explains what you actually baked into them?

    Let’s just forget the BakerySH function exists for a moment and pretend I only have the maps available to me

    Edit: just seen you’ve added Subgraphs for SH, so I may well be able to just port that implementation to ASE... hmmm
     
    Last edited: Nov 20, 2019
  24. dylanjameswalch

    dylanjameswalch

    Joined:
    Jun 20, 2018
    Posts:
    12
    Hello,
    I am attempting to render Light Probes and I am running into this error on certain scenes and can't seem to find any information on why it would not be working. Is there something I am missing? It loads the temp scene and does nothing. When I change into a new scene it throws up to errors.

    The error is: RenderLightProbes Error: lightingDataAsset was not generated
    Followed by: RenderLightProbes Error: No probes in lightingDataAsset

    Thanks for your help!
     

    Attached Files:

  25. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Hi @guycalledfrank - I'm having problems using Bakery to light a scene created with Gaia Pro.

    Unity 2019.2.12.f1
    Gaia Pro 2.0.4
    Bakery 1.65

    First I was attempting to bake lights on a 512 X 512 terrain with trees, props etc. I added the Bakery Direct Light script to the Directional Light, and added a Bakery Skylight. It seemed to just keep hanging on the "Adjusting sample points..."

    Today I tried one of the Bakery example scenes and that worked. Next I tried it on a Gaia Pro created scene with a 256 X 256 terrain and got the following error:
    upload_2019-11-20_17-37-45.png
    upload_2019-11-20_17-37-27.png

    Any ideas on what to try? I attached the ftrace log. I use D:\bakery for the output files, so no weird characters in the pathname. Note that I did many previous attempts to bake Gaia Pro terrains, so the log file has lots of that in it.

    Thanks!
     

    Attached Files:

  26. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    I really don't know whats going on - Unity will bake fine when I use the built-in, progressive or Progressive GPU it just doesn't look as good as yours, I have done stress tests, over/underclocked my GPU/CPU, ensured drivers are up to date, closed everything but unity, and a bunch more and my computer only hard crashes/reboots when I try to bake light with Bakery. I have baked with bakery many many times - this just started recently and it doesn't matter what scene I try to bake. It will warn me about how many lightmaps its going to bake, then a few minutes later my computer crashes. I have a GTX 1070Ti, 64GBs of ram and a 16 core Xeon processor... my computer *SHOULD* be ok, especially since it bakes using Unity's built in lightmapper just fine...
     
  27. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Sounds plausible. Can you try just the trees on a plane? Or even a single tree? How many different meshes are there? Are there many high resolution alpha maps?

    Assuming you're talking about RNM mode:

    See https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf

    Basically it's just 3 lighting values coming from 3 differently bent directions relative to normal:

    upload_2019-11-21_10-36-12.png

    You are probably looking at encoded RGBM values. Make sure you call DecodeLightmap with the same parameters Unity uses for decoding lightmaps on your platform. They should then look like somewhat distorted lighting.

    Assuming you were actually talking about SH mode:

    Yeah, Bakery's SH map files are also named "RNM", because why not. SH and HL2 RNM are in fact conceptually similar, except the basis is different:

    upload_2019-11-21_10-35-50.png

    In SH mode Bakery outputs maps postfixed with _L0, _L1x, _L1y and _L1z.
    _L0 is the first SH coefficient, sort of like a non-directional ambient color. It is stored in full HDR and should look like lighting, albeit darkened and a bit flat. If it doesn't, see my DecodeLightmap remark above.
    _L1* are directional coefficients for different axes. They also represent lighting, but to save memory, they are divided by L0. This way they become non-HDR and only represent differences from L0. First steps BakerySH function does is to decode their full color back:
        float3 nL1x = BakeryTex2D(_RNM0, lmUV, _RNM0_TexelSize) * 2 - 1;
    float3 nL1y = BakeryTex2D(_RNM1, lmUV, _RNM0_TexelSize) * 2 - 1;
    float3 nL1z = BakeryTex2D(_RNM2, lmUV, _RNM0_TexelSize) * 2 - 1;
    float3 L1x = nL1x * L0 * 2;
    float3 L1y = nL1y * L0 * 2;
    float3 L1z = nL1z * L0 * 2;


    Good question. Which Unity version are you using?
    Because Unity doesn't have any way to generate custom Lighting Data Assets from scripts, I have to rely on terrible hacks like creating a temporary probe-only scene and "bake" it using built-in bakers just to obtain an empty asset:

                paths[0] = tempScenePath;
    Lightmapping.BakeMultipleScenes(paths);
    while(Lightmapping.isRunning) yield return null;

    var lightingDataAsset = Lightmapping.lightingDataAsset;
    if (lightingDataAsset == null)
    {
    DebugLogError("RenderLightProbes error: lightingDataAsset was not generated");


    All it really does is just calling Unity's own Lightmapping.BakeMultipleScenes for the temp scene and tries to get the asset. I am not sure why it was not generated. If you reopen the _tempScene after this error and try to manually bake it with e.g. Progressive, does it generate an asset? It should normally appear in Assets\Bakery\_tempScene\LightingData.asset.

    Try disabling Terrain optimization?

    Even with example scenes? Did you check crash details in eventvwr?
     
  28. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    @guycalledfrank thanks, that’s a big help in understanding how this all goes together!
     
    guycalledfrank likes this.
  29. TongLi

    TongLi

    Joined:
    Oct 26, 2019
    Posts:
    2
    Hello, I have a project that is using your plugin. Problems encountered during use.
    The baked light map is exported to other people's computers, the light map will be wrong, and most of the repair will be done after re-ajustUV, but it is not completely repaired.



    win10
    unity2018.4.9f1
    bakery 1.65
     
    Last edited: Nov 21, 2019
  30. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Did you try following these suggestions?

    How exactly does it manifest? Are you unable to delete an .hdr file? Bakery doesn't lock any files, especially after the project is closed. However, some version control systems (e.g. SVN) are known to mark files as read-only.
     
  31. TongLi

    TongLi

    Joined:
    Oct 26, 2019
    Posts:
    2
    I try to "If UVs don't look right, right click affected models and click Reimport."

    I followed the above principles, still can't fix it.

    my gpu 1060 6G
    taget gpu R7 250
     
  32. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
  33. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    Tried a new project with just a new basic terrain and the largest of the trees (the ones I suspected) and baking goes back to randomly failing due to CUDA errors, so it looks like the issue is these trees (specifically the Redwoods from the Coniferous Forest pack).

    Each tree has a LOD group. LOD0 consists of the tree object and an additional object. Each is a single mesh, the tree has 3 materials, the additional object has 1. LOD1 is a single (very basic) mesh with a single material. That said, all the trees in this pack work exactly the same way with that same setup, the only difference is the scale of the mesh (in that these are the largest objects by far, height wise). Could the height alone be causing issues? As that's really the only thing that differentiates them from the others which don't have problems.
     
  34. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    The main light is casting a realtime light into everything even when there are for example, layers where the light should no be casting any light, some lights that are suppose to be baked only, start casting realtime light, also some objects appear to be brighter or darker. My question si, if there is something to load into the "Game Scene" that was only saved in the "Lighting Scene".

    Along with that, baking multipoles scenes at the same time is making some of them to look completely wrong, with black spots and tears everywhere, baking those scenes individually fixes the problem.
     
  35. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    So I just upgraded to 2019.3 so that I could use a version of LWRP that actually works (lots of problems in 2019.2 to do with lighting in the editor, not related to Bakery). Oddly the specular highlights in SH mode don’t appear to be working with the Bakery shader? Pretty sure I had specular showing before. Or maybe it was my imagination and this isn’t entirely what I saw before...

    On the bright side I did manage to port the new graph over to ASE. Just waiting for the ASE devs to update their URP template tomorrow to include a Baked GI override option as only their HD template has one currently
     
    guycalledfrank likes this.
  36. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Thanks.. I'm running a NV 1060 6GB newest drivers 441.20, that fixed it.

    Nope! You can be assured it does switch.
    If absolutely nothing has baked and Lightmaps has cleared bakeded data. Bakery switch anything at run-time and play mode and environment lightning is completely unavailable.

    On delete Bakery from the project, it works as expected. Simple existing of bakery switch environment lighting to off.. of what ever that function call does.

    I posted you a video.
     
    Last edited: Nov 21, 2019
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    There isn't much I can suggest beyond these guidelines, except...
    ...
    there is a new feature in v1.65 that allows saving all UV settings into an asset and locking them. If you select the models (on the machine where it looks correct) and click Bakery->Utilities->Save UV padding to asset, some additional files will be created with names like "modelName_padding.asset". Try committing those to other machines and reimporting models again.

    Interesting. So it's just a sudden power shutdown from the OS perspective. I would suspect a power supply failure. Perhaps the GPU is drawing too much power and it can't provide it anymore.

    Aha! Can you send me one of those trees as unitypackage? I can investigate what makes them behave this way.
    LOD structure sounds OK. Height shouldn't be a problem.

    Right. Unity has some special nasty hidden flags for realtime lights that determine the way it is mixed with baked lighting. In fact, switching light type to realtime/baked/mixed doesn't do much unless baking is performed. Only then Light.bakingOutput structure is filled out.
    Try writing a script that does this for your light:
            var output = new LightBakingOutput();
    output.isBaked = true;
    output.lightmapBakeType = LightmapBakeType.Mixed;
    output.mixedLightingMode = MixedLightingMode.Subtractive;
    light.bakingOutput = output;


    It should then instruct Unity to mix your light the same way it worked in your other scene.

    Weird - didn't test 2019.3 yet, but seems to work 2019.2.11. Example scenes have rather subtle specular, but the difference is clearly visible when toggling "Enable Lightmap Specular":

    upload_2019-11-21_23-3-17.png

    Note that lightmap specular is more promiment in gamma color space (although my scenes are all tweaked for linear) - maybe you were comparing to that.

    Very interesting. I'm running 1060 6GB as well and somehow can run both legacy and non-legacy.

    Answered you in PM.
     
    Last edited: Nov 21, 2019
  38. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    aha! that's what i was thinking that the issue might be around, those kind of flags! thanks!!
     
    guycalledfrank likes this.
  39. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    Ok, so I have an example scene that has the issue. How can I get it to you? Even down to hard dependencies only it's still 250MB annoyingly.
     
  40. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    The only thing that confuses me is that even while overclocked I can successfully do stress tests or render lightmaps using unity's built in progressive GPU lightnapper without crashing, I even tried rendering a scene with blender to test and it worked. Just with bakery for some reason, which is super odd because it use to work all the time... I'll keep digging unless you have any ideas.
     
    guycalledfrank likes this.
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Just send it to me via PM or email. BTW, you don't have to include Bakery itself in the package.
     
    Last edited: Nov 22, 2019
  42. Enverex

    Enverex

    Joined:
    Jul 6, 2019
    Posts:
    73
    That doesn't include Bakery, heh. That said, I noticed something I'd forgotten about before. The error log is filled with over 200 of these when baking:

    Code (CSharp):
    1. Float overflow
    2. UnityEngine.Debug:LogError(Object)
    3. ftBuildGraphics:exportVBTraceTexAttribs(List`1, List`1, Vector3[], Vector3[], Vector2[], Int32, Boolean) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:449)
    4. <ExportScene>c__Iterator0:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4739)
    5. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3877)
    6. ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3343)
    7. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ... which seem like they'd be a problem.
     
    guycalledfrank likes this.
  43. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Just tried the network baker for the first time in a while, first time it crashed out due to the server not responding while preparing, and then when I pressed Return on the server it started chucking out the bytes received messages after Unity stopped trying to send data.

    Wired to wireless, but on a fairly beefy wifi network. I deploy gigabyte-sized games to these PCs so I'd not anticipate any issue with some lightmapping data really

    This is on 1.6, I haven't hopped over to 1.65 yet.
     
  44. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    There's no toggle for "Enable Lightmap Specular" on the shader, only "Enable SH" (same thing...?)

    Incidentally, none of the Bakery stuff shows on the BakeryLitHDRP UI as it uses the HDRP Custom Editor, and the aforementioned shader also has a compilation bug where it tries to include Wind.hlsl - I assume this is because it was built for an older version of HDRP though? (Couldn't get the specular to show up either, am I just missing a trick here, or does the specular not work in SRP in some instances?)

    (Is there a Bakery Discord by the way?)
     
    Last edited: Nov 22, 2019
  45. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    So I am not sure what else to do, I think what I am going to do next is take my hard drive (with unity/bakery/etc) to a friends house, plug it in there and try to bake on their hardware and see what happens. I have tried totally removing the graphics drivers and reinstalling, I tired unity 2017 and unity 2018, I ensured I had the latest version of Bakery, I tired unlocking the voltage of the GPU, forcing the fan on and over/under clocking it. All stable while using the FurMark stress test or using a benchmarking software (doesn't crash the computer). If it helps any, the crash ALWAYS happens at the same time in the rendering with Bakery, when it says Exportin Scene - Shaded surface colors... at 55%. Never gets past that and never crashes before it. Unity WILL bake just fine with the progressive GPU but I don't like the results from that, and it seems to take longer than bakery use to.

    Edit: I dont think I ever said this, my specs are:
    Intel Xeon 16 core @ 2.97GHz
    GTX 1070Ti
    64GBs ddr3 ram
    Lenovo (non modular) 1200watt gold power supply
    Lenovo 2 socket motherboard
     
  46. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Got Bakery ported to ASE, success! Only works in URP and HDRP right now as there's no way to override the GI on the Standard shader template (yet...) but the results are identical (Bakery on the right, my ASE implementation on the left)


    upload_2019-11-22_18-7-49.png


    Still no luck with specular though, even with the standard Bakery Lit LWRP shader. :( We'll get there eventually though... Just need to work out where it's going wrong.

    upload_2019-11-22_18-8-22.png

    Should probably check to see if it’s getting to the LMSPEC point on Monday
     
    Last edited: Nov 22, 2019
    guycalledfrank and keeponshading like this.
  47. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    THERE REALLY SHOULD BE IF THERE ISN'T - THAT WOULD BE SO AWESOME.
     
  48. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Yeah @guycalledfrank...

    Let us hassle you in real time instead. ;)
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    ... any more detailed step-by-step explanation of what's happening and where it fails?

    Ah, you are looking at the HDRP shader. Yeah, it doesn't support baked specular, and I will likely deprecate it in favor of new drop-in subgraphs. These are harder to break and easier to extend and combine with your own nodes. First HDRP subgraphs are a part of v1.65 release.

    Good idea

    Yay!

    Just added HDRP subgraphs for lightmapped specular using both dominant direction and SH! Grab the package and try: https://drive.google.com/file/d/1w1FTuorYuxI6EWydwgYFprgmx4tpOxIM/view

    Hehe. I don't have much discord experience. I can open it, but only if people will also help each other :D I'm sure there are already many experienced users who can give some advice to newbies.
     
    POC0bob and keeponshading like this.
  50. POC0bob

    POC0bob

    Joined:
    Feb 22, 2017
    Posts:
    28
    If you need any help, i've been using discord for 3 years now
    :) happy to help there, for all your help here haha.
     
    guycalledfrank likes this.