Search Unity

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

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

  1. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Hmm, maybe this was caused by a one-off using the latest 2019 beta. Went back to to 2018.3 and enabled the RTX baking. Knocks off about a minute for the Sponza demo scenes on my machines (2 v 3 minutes)
     
    guycalledfrank likes this.
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Woah, wouldn't expect that! Does it happen even on simple scenes? Does progress bar finish (says "Finished rendering") and then Unity hangs when it's supposed to import the textures?
     
  3. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Sneak peek of something I hacked today :eek:

    upload_2019-3-10_0-12-33.png

    upload_2019-3-10_0-12-45.png
     
  4. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    I gave Bakery a go with all the scenes in my project together (13 of them currently) and it exited with an out of memory error:

    Bakery-OutOfMemory.jpg

    Is this memory the dedicated VRAM on the gfx card or the system RAM?

    I've got 32GB system ram and there's 8GB VRAM on the RTX 2080. Does Bakery not use the shared GPU memory (of which Task Manager says there is an additional 16GB so the GPU has access to 24GB in total)?

    The error occurred with this line in the console (which is the first instance of the texgi command in the log):

    Code (CSharp):
    1. Running ftraceRTX texgi "C:\Temp\frender" "Intro_LMA3_diffuse" 4 16 52 "Intro_LMA3_diffuse0_HDR.lz4" vbTraceTex.bin
    2. UnityEngine.Debug:Log(Object)
    3. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4305)
    4. ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2993)
    5. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    I noticed that the Dedicated GPU memory was clocked at 7.4GB/8GB (in Task Manager) at the time of the error, so I'm guessing VRAM is paramount here?

    In any case it looks like RTX baking is much faster (at least x2 on my system) than before so great work! :)

    Thanks!
     
    guycalledfrank likes this.
  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Very likely an unreasonably high resolution was used - try reducing Texels per unit. If you think the resolution is OK, and the crash happened during GI, try setting GI VRAM optimization to Force On in advanced settings.
    Have to add this to FAQ now... added.

    Dedicated VRAM, yes.

    Shared memory is not used (and it would be much slower to access anyway). 8 GB is a lot though! You should be able to bake pretty large scenes with it.

    Also if you use terrains, Terrain Optimization may help reducing the VRAM load quite a bit (but it won't work in RTX mode at the moment though).
     
    Last edited: Mar 10, 2019
    tntfoz likes this.
  6. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    I usually just go with your default settings in the Bakery window so Texels per unit is currently set to 20, I'll reduce this down to 12 (or what would you advise?) and force the GI VRAM optimization to On like you suggested

    There are no terrains in the scene (yet!).

    I thought the "split by scene" option might mitigate resolution problems though?

    I'll report back in a few hours after another bake!

    Thanks for your help.

    Edit: Hmm if I force the GI VRAM optimization On then Bakery/Unity uses up all my system ram (32GB) and starts thrashing the virtual memory - is that meant to happen?

    I've started baking again by just reducing the Texels to 12...
     
    Last edited: Mar 10, 2019
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    That might be too much, it's quite a large value even for a Sponza-sized scene.

    From the docs:
    - Large outdoor area: 1 - 5
    - Medium outdoor area: 10 - 20
    - High quality interior: 100

    Nah, it's there just in case you want to stream scenes separately without them having shared resources.

    Not really... probably start without the optimization first.
     
    tntfoz likes this.
  8. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    129
    12 texels worked great!

    Thanks for the extra info and help above.

    Do get a few of these errors though:

    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:452)
    4. <ExportScene>c__Iterator0:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4437)
    5. <RenderLightmapFunc>c__Iterator4:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3337)
    6. ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2993)
    7. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    Are they anything to worry about?
     
    Last edited: Mar 10, 2019
    guycalledfrank likes this.
  9. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    any guidance for how to fix the message in the Bakery skylight script "skylight doesn't match skybox: no _Rotation property, but light is rotated"

    match light toggle doesn't clear the message when pressed so I am trying to figure out how to fix this or even what the problem is
     
  10. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    It was just the one time while baking the Sponza scene from the demo. Was with the 2019 beta. It hung up on the last message (can't recall off the top of my head). Couldn't close, end task, etc. Was forced to restart haha.
     
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    These are not critical, but suspicious nevertheless. Can happen either to odd lightmap UVs (more likely) or too many lightmaps generated (less likely).

    That means your skylight GameObject is rotated, and so the associated cubemap will be also rotated during lighting computation. Default cubemap-based skybox shaders have a _Rotation property to turn the cubemap around, but yours apparently doesn't. Therefore lighting won't match the skybox as it's rendered in Unity, as they have different angles. This is not strictly an error, but a warning, in case consistent lighting is important to you.

    So yeah I guess something's wrong with the beta. Early 2018.3 betas also had some weird behaviours.
     
    tntfoz likes this.
  12. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Hey @guycalledfrank, we've just run into an issue where the 'Remove Ringing' flag on light probes is not being respected by Bakery.

    We've got an outdoor scene that only really consists of one strong directional light, and when light probes are generated, they produce an incorrect spot of lightness on the opposite side of the light probe. Unity offers the 'Remove Ringing' flag to counteract this at the cost of some accuracy, but it doesn't seem to be working when light probes are baked with Bakery. Is this something that can be fixed?

    https://docs.unity3d.com/Manual/class-LightProbeGroup.html#Ringing

     
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm getting an ftrace error about 1/3 into the baking process, last line in ftrace log is:

    Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoHAsync( dstHost, srcDevice, byteCount, hStream.get() ) returned (719): Launch failed)

    Window 10, Nvidia 1060 6GB card. Baking set to Distance Shadowmask. Anything I can do about it?

    I do have a handful of these errors: "Mesh ____l on object _____ has incorrect UVs" -- but I assumed those would just not be included in the bake, rather than causing the bake to fail?

    thanks
    Dave
     
    Last edited: Mar 11, 2019
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    You can't just "respect" that - it's a completely separate feature that Bakery doesn't implement.
    However, if you take a look at Bakery shader in v1.55, check the new Non-Linear Probe SH option, as it aims to mitigate exactly this problem. It can be copied to your own shaders as well, or even patched to engine include files. The downside is that it has some runtime cost.

    If you have any terrains in the scene, try disabling Terrain Optimization in experimental settings.
     
    b4th likes this.
  15. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    How do we get this option? i just updated to the latest version and the checkboxes are gone, but this drop down menu is not there.

    EDIT after restarting unity a couple of times, it appeared and started working.

    Also, about my previous question about subtractive mode and your answer about using fulllight mode, in this regard then the only option to have realtime shadows would be using cascades, right?

    EDIT: Ok, when the dropdown menu appeared and started bakery working as it should, i found my ideal use for the project: using the Indirect lighting mode, baking direct and direct light in skylight and only indirect in sun light and using cascades.

    THANKS!
     
    Last edited: Mar 11, 2019
    guycalledfrank likes this.
  16. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    okay...where is that? (Forgot to mention I'm using 2018.2)
     
  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    It doesn't show in Full Lighting mode, as it won't make any difference there.

    Realtime directional shadows are always implemented via cascades, the only difference is which objects are rendered into them (all or dynamic casters only). There must be some scripted way to force the light only draw dynamic things - take a look at this maybe.

    Set settings to Experimental (where is says Simple or Advanced). Scroll down quite a bit.
     
  18. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Hey guy!

    I'm here again to report some issues that I've found while messing around with Bakery.

    1) My Bakery Point Lights are not showing the Baked Contribution options when I add the Bakery Point Light script on them, this option only shows after I bake the lights at least once.



    2) My lightmaps are not syncing on different computers. If I bake on PC 1 then commit these maps and open them on PC 2 the same lightmaps on PC 2 will be broken. I don't know why this is happening. We've migrated from Git back to Hg (with a clean repository) and we followed the steps on the documentation to Ignore bakery Folders correctly, but this didn't solve this issue for us. I've checked that we aren't using Adjust UV padding because it seems that this could be causing the issue? We have multiple scenes that have the same object in them (like cave walls that we use in different ways) and if one scene adjusts the UV the other will break, correct? But I've made sure no one is using this option to bake.

    3) When you press Check for UVs then it finds an Overlapped UV and you press Stop, when you try to bake again it gives you an error (something to do with heightmaps). Then you need to press Render again for it to work.
     
    Last edited: Mar 12, 2019
  19. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Oh, in Bakery, right! Okay, I've done that, but now I get "Error (1282) Memory allocation failed (Details: Function "_rtContextLaunch2D" caught exception: Out of memory" -- it happens during Rendering GI Bounce 0.

    I figured my scene must just have too much stuff in it, but I get it even when I select the terrain and just one structure, and click Render Selected Groups. I've set Texels per unit to 5, and other values are defaults. Directional mode is None. I've got a 1060 card with 6GB of memory, so seems odd to run out.... Anything I can try?
     
  20. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    if choose to "Download and Import" rather than just "Download" it will place a copy in your project folder. Otherwise, the files are not tied to any particular project, so they are placed in the shared data folder on your local machine.

    For windows users:
    1. open file explorer (WinKey + E)
    2. type %APPDATA% for the path, then click ENTER
    3. Select Unity folder and goes to Asset Store..

    or simply type this into the file explorer: %APPDATA%\Unity\Asset Store
     
    guycalledfrank likes this.
  21. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    Hi frank I know this has been asked before however I am just looking for a update if speed tree assets have been tested yet ? I am putting a road map together for a new world and currently planning to use a lot of Gaia and speed tree assets. thank you and keep up the good work, it would not be possible with out you
     
    guycalledfrank likes this.
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Read the post before your question.

    Does the 2nd PC have Bakery installed? Do you only commit project files, not Bakery folders? Make sure you also commit model meta files and the scene, not just the maps.

    Can happen, there is a long answer about this (and how to fix it) in FAQ.

    Can you check if it created some objects named __ExportTerrain in the scene? If it did, delete them manually. Will take a look if that's the case.

    I now added a section about all out of memory problems with all possible causes/solutions to FAQ.

    Didn't work on it yet.... but still on the roadmap.
     
    Last edited: Mar 12, 2019
    DEEnvironment likes this.
  23. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Apologies, when I said "respect", I meant "support / take into consideration". But good to hear that there is now a solution in the Bakery shader. Just upgraded and tested and it's working well. Many thanks!

     
    guycalledfrank likes this.
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Great! Looking at how Unity's ringing fix works, I can also add something like that. It does result in some lack of contrast though, while non-linear SH sampling avoids that.
     
    b4th likes this.
  25. b4th

    b4th

    Joined:
    Jul 4, 2016
    Posts:
    65
    Ah, I may have spoken too soon. Non-linear SH sampling works well *in the Editor*, however it's causing some really strange results on our target device (Oculus Go, Android). The probe lighting on a moving object seems to be flickering, alternating between looking correct, then pitch black, then tinted red. It's difficult to capture in a screenshot. Do you need a repro case to be able to investigate?
     
    Last edited: Mar 12, 2019
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Weird! Yeah, that would definitely help.
     
  27. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    so have a question what process is going when bakery is switching from gamma mode at start of project? during its switch it started looking for assets if need reimporting. not certain if bakery related as its new project but after it started to re crunch every texture again … wish we had a GPU cruncher now ;)
     
    Last edited: Mar 13, 2019
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Oh it just calls this:

    if (EditorUtility.DisplayDialog("Bakery", "Linear lighting mode is essential for getting realistic results. Switching the project may force Unity to reimport assets. It can take some time, depending on project size. Continue?", "OK", "Cancel"))
    {
    PlayerSettings.colorSpace = ColorSpace.Linear;
    }
     
    DEEnvironment likes this.
  29. luellasfpg

    luellasfpg

    Joined:
    Jan 23, 2019
    Posts:
    16
    Hi, so reading some of the previous posts it seems like different LOD levels can't share the same atlas. This is a problem for us, as our scenes are set up of dozens of prefabs, each with their own finely tuned LOD level percentages. This means that even with our atlas resolution set to 2k, we're getting 6+ lightmaps when ideally we only want one. We're in the last stages of optimizing a VR game so every draw call counts.

    We're looking for something similar to the way the CPU Progressive Lightmapper packs the atlases (all LODs on one lightmap), is any support planned for this feature anytime soon? Otherwise I wouldn't mind taking a crack at trying to implement it myself, could you give any pointers on what parts of the code we need to change to do this ?

    (Image on the left shows Bakery light maps, image on the right shows the Progressive lightmaps that are tightly packed, which is more similar to what we're trying to achieve.)

    image.png upload_2019-3-13_11-24-17.png
     
  30. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Thanks for the replys!

    Woah, I was dumb, I tried reading some posts before mine but I didn't see that one!

    Yes, 2nd PC has bakery, same version. We don't commit model .meta because we're not using Adjust UV Padding. I've just saw in the FAQ that for non-bakery PC it needed some scripts. I uningnored and commited those. I'm doing some bakes here, will come back to see if we managed to fix it.

    Here's a video of the Overlapping UV bug happening:


    Also after a 7h bake I got this error and the lightmap didn't finish.


    Here's the log https://www.dropbox.com/s/440e1j5hg88ln2p/.ftracelog.zip?dl=0

    I'm getting very weird results when trying to bake using Light Mesh or Emissive. There are a ton of artifacts appearing and I don't know how to get rid of them. I've been re-opening all the UV2s on Maya to guarantee that it's not a Unity-UV thing but these things keep appearing... There are no lights on this scene, just the Plane with a LightMesh (i also have a version of that plane with no LightMesh script but a very strong emissive material)

     
    Last edited: Mar 13, 2019
    guycalledfrank likes this.
  31. Artificial_Illusions

    Artificial_Illusions

    Joined:
    Jul 24, 2018
    Posts:
    20
    Hello, has anyone also experienced weird reflections on their probes? After light baking, all of my reflection probes are showing inaccuracies and thus, the reflective surfaces (such as the mirror) look really bad.

    upload_2019-3-13_16-19-46.png
     
    rolando75 likes this.
  32. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    I keep getting this warning in my log after rendering lightmaps with Bakery.
    The loaded level has a different lightmaps mode than the current one. Current: Non-Directional. Loaded: Directional. Will use: Non-Directional.

    What does this affect, if anything, and how do I fix it?

    EDIT: Also my light probes are more or less unusable.

    I've done some research and it looks like this is a Unity bug, not a Bakery problem. But maybe Bakery can do something to fix it or make it better?
    I'm using Alloy shaders for the majority of objects in the scene, for such effects as POM and some glass. As such I can't simply switch to the Bakery version of the standard shader; I'd lose POM and everything else Alloy offers.

    EDIT Again: To see how things would look, I switched most of my materials to the Bakery standard shader and enabled the appropriate options to eliminate these artifacts. It looks great in editor but then it doesn't work with VRChat; it's as if there are no lightmaps at all. So I cannot use SH lightmaps, which therefore means I cannot use the Bakery shaders.
     
    Last edited: Mar 14, 2019
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Yes.

    The trick is to join multiple lightmaps after the bake is done. It can be in fact done in a custom script without changing Bakery code.

    Did you bake these models on the same machine with UV padding adjustment before though? If so... their UVs could be stuck in the adjusted state on your machine (but not on others).

    Option A:
    - Make sure others machines have ftModelPostProcessor.cs
    - Commit model meta
    - Reimport models on other machines to match the UVs

    Option B:
    - Open ftModelPostProcessor.cs
    - Remove all lines with Unwrapping.GenerateSecondaryUVSet, save
    - Reimport the models on your machine - that will get rid of Bakery adjustments

    Ouch. Yes, I can see why it's happening. Added a fix, will commit it to github soon.

    Possibly no disk space. Or did you use "Render Selected Groups" by any chance? Also please send me
    D:/BakeryTemp\light_291222539_4_Dir.lz4 to check, this is the file it's complaining about.

    Can you show this one? For a very large emitter like this I would go with plain emissive.

    Reflection probes are rendered the same way Unity normally does, I didn't implement this. I just call BakeAllReflectionProbesSnapshots, (same thing is called from ReflectionProbe/Lighting window UI).

    This is fine and safe to ignore.

    L1 mode or Legacy?
    L1 is experimental at this point. I suggest you use Legacy and "Render Light Probes" button instead, as L1 doesn't work great without non-linear sampling in the shader and generally doesn't work great for high-contrast direct lighting.
    The point of adding was mostly to prepare the ground for probe volumes.

    You can use SH lightmaps in VRChat with this. Also VRChat devs recently contacted me asking if they can include Bakery scripts in the game itself, so seems like it's gonna get easier soon.
    Also you can use Bakery shader without using SH lightmaps.
     
    Tudor, DEEnvironment and Ar7ific1al like this.
  34. zizi

    zizi

    Joined:
    Nov 8, 2012
    Posts:
    1
    Hi, Frank!

    Just want to report that Bakery Light Mesh cannot be baked into lightprobe unless the material is right and has "Static" toggled on gameobject. Is this by design? Analytic light doesn't need to do that.

    Baking mode is Legacy, not the new "L1" mode. Also I suggest that SH data should be interchangeable between Unity SH and Linear-sampled SH. :)
     
    guycalledfrank likes this.
  35. liudian208

    liudian208

    Joined:
    Aug 30, 2018
    Posts:
    59
    Hi Arthur, I just updated to 1.551 and I encountered because of my Terrain. Any idea? 1.4 and before it's OK. And I tried to compare codes but couldn't figure out why. Any idea? upload_2019-3-14_20-34-11.png
     
  36. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    Ah, okay. I'll try switching back to legacy and doing it that way.
    That's pretty awesome; I'll check out that Bakery VRChat adapter.
    And I'm looking forward to VRChat whitelisting Bakery components! That's incredibly good news!
     
    DEEnvironment and guycalledfrank like this.
  37. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm still having problems baking my scene. A simple test scene worked fine in my project, but when I try a bigger scene, Bakery works for awhile (an hour? Not sure, I left it overnight), and then errors out. Any idea what it means? Here's the last part of ftracelog:

    Lightmapping test_LMA4_final_HDR.lz4
    Done
    Init...
    fixpos12
    Loading geometry...
    Loading alphas...
    Tile size: 512
    Used host memory: 0mb, available GPU memory: 4965mb
    MODE: fixpos12
    USING FLOAT
    Load shaders...
    Loading shader fixPos12.ptx::eek:xMain...
    Loading shader lambert_backface_check.ptx::eek:xMain...
    Loading shader shadow.ptx::eek:xMain...
    Loading shader trimesh.ptx::intersect...
    Loading shader trimesh.ptx::bbox...
    Used host memory: 0mb, available GPU memory: 4965mb
    Used host memory: 0mb, available GPU memory: 4965mb
    Create buffer...
    Num passes: 2
    Num tex: 2
    Pass uvpos_Tajnia 1_LMA1.lz4_HDR...
    Skipping pass Mask
    Used host memory: 0mb, available GPU memory: 4965mb
    Launch 1x1 tiles...
    Tile 0x0...
    Streaming...0
    nFNFPFSd
    Launching...
    Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoH( dstHost, srcDevice, byteCount ) returned (719): Launch failed)
     
  38. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Network baking seems to work!



    - Doesn't perform distributed rendering yet, but you can offload baking to another PC;
    - The idea is to use it over LAN, not over Internet (large data transfers);
    - Server PC doesn't need Unity installed;
    - Client PC doesn't require Nvidia GPU.
    - Doesn't currently support GI VRAM optimization;

    You can grab it on github and test.
    On top of that, I created a new repository for the engine-agnostic, compiled part of Bakery. I added everyone who was in the previous repo, so here you go: https://github.com/guycalledfrank/bakery-compiled/invitations
    There is also a couple of fixes.

    To use network baking:

    - Run ftServer on server PC. Simply double-clicking it will make it work, but its temp folder will be set to Users/You/AppData/Local/Temp/ftServer. If you want it to be in another folder, you'll need to specify it as an argument to ftServer either via command line, a bat file or with a simple shortcut.

    - On client PC, set settings to Experimental, scroll the window down and check "Bake on remote server". Type the server IP in (make sure you can ping this IP).

    - Click "Connect to server". Now Bakery window will monitor current server status. If it says "Idle", you're ready to go.

    - Click the regular Render button. Status should now display baking progress.

    - After the bake is done, it will say "Idle" again. Click "Get data" to import and apply the lightmaps.

    Seems to be a bug. Also shouldn't happen in L1 mode. Also I'm gonna add a new L2 mode that's better than both of these.

    In low-contrast scenes it kinda is.
    However I might have missed some steps in radiance->irradiance conversion in L1 mode, so will investigate it further...

    Not really. Do you have any objects named __ExportTerrain left in the scene?

    Is it with terrains and Terrain optimization disabled?
     
    liudian208 and Adam-Bailey like this.
  39. Raistmere

    Raistmere

    Joined:
    Oct 12, 2016
    Posts:
    5
    Hey @guycalledfrank, I'm running into a problem with an artifact that I can't seem to fix. After every bake, everything seems fine except for these weird "stretchmarks". I tried changing the settings from low texel to higher and they always seem to show up no matter what. I thought maybe it was my models/UVs and was wondering if you know what they are.

    I posted both the image and the settings related to the problem.
    Problem.png Settings.png

    I appreciate your time and thanks for creating bakery, it really speeds up the lighting time :).

    Thank You!
     
    guycalledfrank likes this.
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Can you check if these are related to seam fixer, i.e. disable "Fix seams" and see if it's gone?
     
  41. Raistmere

    Raistmere

    Joined:
    Oct 12, 2016
    Posts:
    5
    I will try that now and let you know.

    Thank you!
     
  42. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Ok, this is a long one, we've solved the issue but please read on :)

    We've been baking on 3 different PCs, on my personal PC I had a clean install and made sure I had never, ever used Adjust UV. On my other developers 2 PCs they've baked using Adjust UV by mistake but every time they've done so I made sure they did 2 things: Did NOT commit the .fbx metas and they REVERTED those .metas on our GIT/Hg before we did the final bake. Thing is that we just figured out that Bakery somehow keeps those changes even if we revert the .metas! So we ended up discovering this because I sent over a lightmap done on PC 1 with clean UV2s to PC 2 (which had previously baked stuff with Adjust UVs but had reverted the .meta) and after reimporting ALL the .fbx the Lightmaps were perfect!

    I wanted to ask you to please add a global option of disabling Adjust UV padding for ALL scenes. This is because every time we open a scene (we have a lot os scenes) we have to configure bakery to disable this option because it comes enabled by default! Also, having a way to set a global preset of render for every scene would be the best thing ever, having to open a scene and each time manually set them to Shadowmask, Dominant, unchecking Adjust, bla bla bla is the worst :/


    Thanks! :)


    Yeah, I figured that could be the cause so before you replied I ended up deleting the entire BakeryTemp folder, so there's no file to send you right now, sorry! But after that, the bake went smoothly. It's very strange how much space the BakeryTemp folder takes and Bakery doesn't seem to clean that folder very often, which have led for us to have a BakeryTemp folder of over 50gb! Is there a way to fix this? Is it good to maintain those temp files over different bakes? Shouldn't you delete them after each bake? (honest questions)

    Of course! And after reading the documentation and doing a lot of testing I almost got it to work perfectly. You're correct that plain emissive is the way to go on this one but I'm still getting very weird artifacts. Keep in mind those artifacts are happening on meshes that had their UV2s open on maya (After the errors keps appearing I opened almost all the UV2s on this scene in Maya to guarantee the best result possible).

     
  43. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Hey @guycalledfrank, any idea what might be causing this artifacting (lightmap in following image):





    Decently large scene that I am testing, so texels per unit is set to 16:



    However, increasing texel density still has the artifacting.

    Here are my settings:

     
  44. Raistmere

    Raistmere

    Joined:
    Oct 12, 2016
    Posts:
    5
    Hey @guycalledfrank, I did what you told me. After the bake was finished, the problem still exists. Some more info, I am using magica voxel models > export obj into unity > Using standard shader + unity generate uvs.
     
  45. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437

    just a follow up we removed speed tree from are roadmap as it has so many issues
     
    Last edited: Mar 15, 2019
  46. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    Tried out the VRChat Bakery adapter you linked me to. It didn't work at first. I noticed some errors in my console (didn't know when they were generated, so I didn't save them) so I reverted the changes made by the adapter script, then tried again. It worked the second time, which is odd; I didn't change anything. lol
    It looks great. SH lightmapping is incredibly superior to dominant direction. I could already tell this in the editor, but seeing it work in VRChat (about to log on with my Oculus to see it in first person) is even more incredible.
    I'm loving Bakery. Now if only I can figure out how to get it working right with my large outdoor world! lol I may just have to bite the bullet and downsize the world overall. I'll work on some other worlds before I continue with that one, though. I have a few that need to be rebuilt and published first.
     
    guycalledfrank likes this.
  47. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    An easier way to save/load setting presets should help - will add.
    For now you can kinda do it by saving settings to Lightmapped Prefabs and loading them back in another scene.

    It's already there by the way!

    Well... it just really never cleans it. I'm a bit paranoid about auto-deleting anything, and the files there are especially useful for debugging when something goes wrong. Perhaps I should at least add a manual cleanup button.

    OK yeah that's weird. Is the emissive texture (if there is any) only used on the lava mesh, or is it a part of some larger texture atlas? Also can you try putting the lava to its own Lightmap Group and see if it helps?

    My bet is on odd self-intersecting geometry or UVs. Checker looks alright though. Are UVs auto-generated by Unity? Can you show the (transparent) wireframe?

    Can you share any of these models for me to test?
     
  48. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    2017.4.22 - I'm unable to get the asset to compile after loading from the asset store, none of the windows/menus show up in the editor. It works in other/new projects.

    Any ideas? Not making any changes to the default file import.
     
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,672
    Any console errors? Note that any script in the project failing to compile will block other scripts' compilation (including Bakery).
     
  50. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Fixed with uninstall/delete Bakery folders, restart Unity and PC (and wait one week), then try again after freshly starting the engine.

    Edit: its working fantastically well. Anyone making a 3D game (and not on 2018.3 with its GPU lightmapper) should be using this. The productivity improvements are immense. I'm probably able to get through the design of a level in 20% less time.
     
    Last edited: Mar 15, 2019
    guycalledfrank likes this.