Search Unity

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

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

  1. HenriSweco

    HenriSweco

    Joined:
    Aug 8, 2016
    Posts:
    28
    Is the perspective just messing me up, or are those lightprobes under the table(thus shadowed)?
     
  2. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    2018.2.16
     
  3. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Can you elaborate on what "Render Selected Groups" does and what it requires?

    Here's a quick mockup I did using Bakery. I have to admit, it does a fine job.
     
    Last edited: Dec 1, 2018
  4. drcrck

    drcrck

    Joined:
    May 23, 2017
    Posts:
    328
    asset store page:



    pdf manual:



    my reaction:

     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    That's also my reaction to your post, what is your point? Bakery is not a realtime GI solution. It's a baked GI solution.
     
    slimshader and guycalledfrank like this.
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Your setup is perfect and highly tested, everything should be fine. Maybe the probes are too close to the floor and don't catch enough bounced lighting from the wall?

    I hoped it was covered well enough in the docs :)
    https://docs.google.com/document/d/19ZDUAVJA69YHLMMCzc3FOneTM5IfEGeiLd7P_qYfJ9c/edit#
    Or do you have any specific questions or not sure about something?

    Wow! This is really nice!

    Exactly. Bakery bakes static global illumination into lightmap textures. That's the definition of lightmapping.
     
  7. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Hey did you ever add this fix?
    Also, does it support reading the alpha value of the meta pass? That would solve a lot of problems for me.
     
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Not yet, but it's coming... as a workaround you can:
    a) Disable shadowcasting from objects with semi-transparent alpha value.
    b) Use alpha texture.

    Currently not. Albedo and emissive data is taken from the meta pass, but alpha goes straight from either _MainTex.a or _BaseColorMap.a.
    The reason is to keep alpha map resolution intact. E.g. imagine a chainlink fence with a low resolution lightmap - the texture is small and tiled, and redrawing it as part of the meta pass would completely dissolve the detail. If a large spotlight illuminates a wall behind the fence, it needs really good resolution (for the alpha, not for final ligntmap). All kinds of dramatic/noir lighting setups involving alpha textures will benefit from that:







    Meta pass approach won't give enough detail, unless you make the fence use much higher resolution than necessary.

    However, I agree that there are different cases, and meta pass would be the only option for procedural opacity, so I'm definitely planning to add it as second option.
     
    Mark_01 and Invertex like this.
  9. andracer108

    andracer108

    Joined:
    Dec 12, 2016
    Posts:
    35
    Hi @guycalledfrank! It's me again. A few pages ago, I asked you regarding whether your tool would be useful for large terrain and open world games. You told me that it could be by making the shadow system "hybrid" and using high quality real-time shadows when the player is close to the shadow and low quality baked shadows when the shadows are far away and for the terrain in general. This was what I already had implemented before and I thought a lot about it and also did some research.

    However, I only ended up with more questions. For example, at one point, you mentioned my heightmap density but wouldn't that be fixed if I were to split up my terrain into multiple chunks or by using an asset like SECTR Stream (which essentially, is capable of splitting up terrain)? Another question I was meaning to ask is that Unity's new GPU lightmapper is currently in preview however, people are still complaining about certain processes like the infamous "clustering" process. After some research, I discovered that Unity still uses the CPU for processes such as clustering in their GPU lightmapper. Which I found strange as for me, it shouldn't be called a GPU lightmapper if there are parts of it that didn't use the GPU at all. So, I was meaning to ask, does Bakery fully use the GPU in the baking process? I'm sorry if this is a stupid question, but once I saw the Unity GPU lightmapper, I started wondering about it.

    I also may get into shader programming soon. So, if you believe that shaders would help me with lightmapping huge terrains, I would appreciate some tips about it as well unless it is something super advanced and not for a shader beginner. :)

    Thank you for reading. Regards,
    Andracer108
     
    Last edited: Dec 2, 2018
    guycalledfrank likes this.
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    If they cast shadows/GI onto each other, all geometry has to be loaded at lightmapping time.

    AFAIK, clustering is only specific to Enlighten, and Progressive (nor CPU neither GPU) doesn't perform it. Or perhaps I just never noticed it doing this step.

    There are multiple tasks Bakery runs during baking:
    Scene Export: packs the scene into atlases, exports geometry and textures to the lightmapper. Mostly a CPU job. Also when you bake a scene for the first time (or after changing lightmap resolution), it may try to optimize UV padding in meshes, and it does it using Unity's own unwrapper (CPU).
    Baking itself: completely a GPU job, however each baking step will also read/write some data, so it slightly depends on I/O speed too.
    Denoising: GPU.
    Seam fixing: finds seams on the CPU, but fixes them on the GPU.

    So scene export may take some CPU time before the actual bake (depending on scene complexity), but after that you're 95% GPU-bound. Scene export is usually much faster than Enlighten clustering process though.
     
  11. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    The camera preview feature sounds great! I look forward to that feature! :)
     
    guycalledfrank likes this.
  12. DJKson

    DJKson

    Joined:
    Dec 2, 2018
    Posts:
    3
    Hi @guycalledfrank, bakery is really awesome.
    But I have a question while using it, is it possible to bake a point light which is inside a mesh?

    1.jpg
    For example, if I use Unity progressive lightmapper, the light of that point light can pass through the cube even it is inside the cube

    but if I use Bakery

    2.jpg
    It seems that the light cannot pass through the mesh from inside.
    Is there any workaround I can do or some kind of settings I've missed?
    Thanks!
     
    guycalledfrank likes this.
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Not really, as both front/back faces are considered opaque. Perhaps you can just disable Cast Shadows on the cube around the light? Or disable shadows on the light itself (samples = 0)?
     
    DJKson likes this.
  14. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    For mobile time of day lightmap, with custom shader, would it be possible to bake zonal harmonics (since time of day is radial)? Imean since you already have the code for SH, the great thing is that ZH are linear in cost, so while sh3 is 7 floats per channel (21 for rgb) zh3 is only 4, and since time of day is shadow, it's only intensity and can go up to 8 for zh7 (two maps) which is fine grained. And also it might work for 3d zh texture to project time of day into dynamic object. Do you think it's a good idea?

    Also can bakery bake random material data in the lightmap (mostly albedo, world normal and world position) which would be faster since it's not tracing? My idea is to replace the "indirection tile map", (which I proposed earlier) by an index tilemap that reference dual paraboloid atlas that encode UV of the scene (and the two side are encoded in a single tile since uv takes only two floats). So now each point fetch the index number to the paraboloid, then in the atlas fetch the UV using the normal, then fetch back the lightmap result of the "direct light lightmap".
     
    guycalledfrank likes this.
  15. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hi there!

    For some reason, bakery blows out my inspectors colors when I hit bake and it gets stuck this way until I restart the editor..!

    Before hitting render:
    before.PNG

    After hitting render..:

    after.PNG

    edit:

    this doesnt happen if my project is in Linear mode.
     
  16. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Also, would love to hear what kind of things are planned for the new lightprobe system? :)
     
  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Woah. I never tried zonal harmonics before, but yes, that might work. So you only want grayscale occlusion for multiple sun arc segments, right?
    It might take time to research, but if you already know how to get it working (what basis/weights should be used), it shouldn't be hard to add.

    Are you using 2017.3? Seems like a bug in recent versions of Unity. I don't touch global UI :)

    3D texture slabs. Pros:
    - You place boxes (volumes) instead of single probes.
    - Objects can be lit by multiple interpolated probes per-pixel (like LPPV).
    - Faster/lower hardware requirements comparing to LPPV.
    - Avoiding spherical harmonics artifacts in high-contrast areas (negative color shifting).
    - Can be used for particle/fog lighting in custom shaders.
    - Can move/swap slabs at runtime.
    - Much faster for the lightmapper to bake, doesn't have to mess with LightingData assets.
    Cons:
    - Lower precision (L1 SH instead of L2). Sufficient for indirect, but not as good for direct lighting.
    - Shader modification needed (I'm adding one to the Shader Tweaks menu, so most built-in and surface shaders will work).
    - Might be somewhat slower on mobile (emulated 3D texture read instead of uniforms).

    I'm still leaving the old system, but the new one will have its uses.
     
  18. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Yep! Could probably handle soft shadow too by integrating the sun disk per arc.... and the moon since it's a circle.
    In theory, ZH are just SH but with only one axis, so only m0 for every lx, I haven't fully understand sh to implement them myself, but I think the weight also change based on the windowing of the signal too? I made a mistake, sh3 is 16 floats per channel, I meant to say sh2 and zh2 (ie band 3). Where did I get that sh2 is 7 floats when it's 9 :rolleyes:

    Wikipedia has a table of all bands up to 10
    https://en.wikipedia.org/wiki/Table_of_spherical_harmonics

    No comment on that? :D

    I don't mean shader baking (though that would be nice if possible) I meant just transferring texture data to the lightmap (ie bake the tiling too to the lower resolution of the lightmap). I figure out that since you can already bake the normal, it might be trivial to implement.
     
    Last edited: Dec 3, 2018
  19. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    2018.3 beta!

    That sounds sweet! I am interested in mobile, so happy to be your guinea pig for performance testing, hehe.
     
    guycalledfrank likes this.
  20. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    @Prodigga,
    Already reported that issue back on early november, case number #1092485, and they mentioned they able to reproduce the issue and been forwarding to the unity's devs, no issue tracker yet being given.
     
    guycalledfrank and Prodigga like this.
  21. dylanjameswalch

    dylanjameswalch

    Joined:
    Jun 20, 2018
    Posts:
    12
    I am receiving the same error with the Skylight. Did you ever find a solution to this? Thanks for your help.
     

    Attached Files:

  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Yeah, it was a bug related to area lights and it was fixed.
    In your case it might happen due to a very high sample count. What samples value are you using on the Skylight?
     
  23. DJKson

    DJKson

    Joined:
    Dec 2, 2018
    Posts:
    3
    Hi again,

    The baked lightmap seems disconnected to the scene if the I set active to another scenes.
    1.jpg
    2.jpg
    As my current project is in multiple scenes structure and may often change active scene, is it possible to keep connection between scenes and lightmap even if the active scene changed?

    Thanks for your help!
     
    guycalledfrank likes this.
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    I'm not sure exactly why it happens yet, but going to investigate soon, as it's pretty annoying. Seems like Unity resets something regarding lighting settings when you switch. Sorry for inconvenience.
     
    DJKson likes this.
  25. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    hi! i have to admit, you have an awesome Asset and incredible work done, our current project could not be made without this asset (im serious) so, thank you!

    Now a have a couple of questions:

    1) when i bake the light probes, there is no result, there is a "process" but not a result, the Lightprobes only get actually baked when the "occlusion probes" check is active.
    2) i'm getting a error with keywords: upload_2018-12-3_18-35-57.png

    im in unity 2018.3, i know that this version is not jet supported, but this might help to fix something before hand.

    Thanks again!
     
    guycalledfrank likes this.
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Any errors during the process?

    Seems like a problem with your shader. I don't really recognize these keywords.
     
  27. DJKson

    DJKson

    Joined:
    Dec 2, 2018
    Posts:
    3
    Thanks!
    Do you know any workarounds to retain the lightmap data at run time? I tried using lightmap prefab but it doesn't work

    Edit:
    Tested the lightmap works fine on android, maybe it is unity editor problem
     
    Last edited: Dec 4, 2018
    guycalledfrank likes this.
  28. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I'm back, I was very happy with my last bake so I worked on my level for another week or so but then when I went to do another bake I get 56,000 red errors like this :

    Float overflow
    0x000000014153B688 (Unity) StackWalker::GetCurrentCallstack
    0x0000000141541BC6 (Unity) StackWalker::ShowCallstack
    0x0000000141410F5B (Unity) GetStacktrace
    0x00000001408B1E60 (Unity) DebugStringToFile
    0x00000001418E09C8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x00000000771F2C90 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x00000000771F2B63 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x00000000771F07F1 (Mono JIT Code) [SLCLogHandler.cs:66] SimpleLogChannels.SLCLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007648FE8D (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x0000000073058CD9 (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    0x000000007307B97B (Mono JIT Code) [ftBuildGraphics.cs:423] ftBuildGraphics:exportVBTraceTexAttribs (System.Collections.Generic.List`1<single>,System.Collections.Generic.List`1<single>,UnityEngine.Vector3[],UnityEngine.Vector3[],UnityEngine.Vector2[],int,bool)
    0x0000000073345B2B (Mono JIT Code) [ftBuildGraphics.cs:3618] ftBuildGraphics/<ExportScene>c__Iterator0:MoveNext ()
    0x00000000732C5DED (Mono JIT Code) [ftRenderLightmap.cs:2886] ftRenderLightmap/<RenderLightmapFunc>c__Iterator2:MoveNext ()
    0x0000000073057309 (Mono JIT Code) [ftRenderLightmap.cs:2549] ftRenderLightmap:RenderLightmapUpdate ()
    0x000000007649D817 (Mono JIT Code) (wrapper delegate-invoke) <Module>:invoke_void ()
    0x000000007649D51D (Mono JIT Code) [EditorApplication.cs:191] UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    0x00000000552C9F55 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FF91730A69B ((<unknown>))
    0x00007FF917291BB2 ((<unknown>))
    0x00007FF91729AB9F ((<unknown>))
    0x0000000140BFDF47 (Unity) CallStaticMonoMethod
    0x0000000140BFDCCE (Unity) CallStaticMonoMethod
    0x00000001413E24D3 (Unity) SceneTracker::Update
    0x000000014144E2C8 (Unity) Application::TickTimer
    0x00000001415EDDA5 (Unity) MainMessageLoop
    0x00000001415F0198 (Unity) WinMain
    0x0000000142434B9A (Unity) __scrt_common_main_seh
    0x00007FF94BD61FE4 (KERNEL32) BaseThreadInitThunk
    0x00007FF94E8EF061 (ntdll) RtlUserThreadStart

    Ideas?
     
    guycalledfrank likes this.
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Do you have
    - LOTS of Light Meshes / Area Lights?
    - LOTS of lightmaps being generated?
     
  30. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Im not sure what light meshes or area lights are. I have A LOT of bakery point lights and A LOT of geometry but Im sure it worked last week even (ive added a bit but not a huge amount). My scene is split into 3 sections, 1 section bakes ok, other ones have this error and memory quickly rushes up to max out my 32 gig and hangs pc for a long time and fails.

    Im looking for ways to print out any model that is specifically to blame or any other clues.
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Argh, it has now killed EVERY material in my game they all look completely detailess, even after I have cleared the baked light!!!!! What do I do now ??? I pray I can get back!

    edit: the materials themselves look fine but everything in scene is rendered as if theres no shader or something.. :-(

    edit: game plays fine with materials working thank god, but something seems to be up with the scene view, ive got it set to "shaded" but it looks like some other mode.

    FINAL edit: OK, must be unity bug, I right clicked on scene and add tab->scene and the new one was working again... im almost felt my heart stop beating there :)

    But yeah I still cant actually bake my scene, I wonder if it didnt work last week, but it seemed so much faster and appeared to work.
     
    Last edited: Dec 4, 2018
    guycalledfrank likes this.
  32. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    It has to do something with the amount of lightmaps you get. How many of them are in your scene, or how many were generated last time it worked? How do you bake each section?
     
  33. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hi, well I only got about 7 megs worth the first time ( I cant recall how many maybe like 30, they were very very small), I think I was using texels per unit 1 (or maybe I was using a float lower than 1, its hard to tell because the plugin doesnt seem to save my prefs). Also last time I baked the entire scene and it worked. Anyway I will try again using 0.1, that should be easier on it.

    edit: no luck even on 0.1 texels, it seems to spiral out of control uses 16 gig of ram in seconds then hangs pc..
     
    Last edited: Dec 4, 2018
  34. haltor

    haltor

    Joined:
    May 22, 2017
    Posts:
    4
    Hi, I'm on 2018.2.1f1 using LWRP. After rendering the scene any new object I add looks pink/red/blue like this:
    shaderIssue.JPG
    Notice, that It's not the unity shader error magenta color.


    When I press Update Skybox Probe, it corrects to this:
    shaderIssueAfterUpdateSkylight.JPG

    But when I hit play, all new objects go back to the pink/red/blue look. Sphere and cube are Unity native 3D objects by the way. And all materials are LWRP standard (doesn't matter physically based, simple lighting or unlit).

    Any idea how to fix this? This is the last bit we need to fix to complete and submit this project so any help would be very much appreciated.
     
  35. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Perhaps it's caused by some specific unusual model?

    I'm not currently sure why it happens in the first place, BUT if you call

    DynamicGI.UpdateEnvironment();

    It should fix itself. The prefiltered skybox probe is buried somewhere in the LightingData asset with no API, so the best I can do is to call this function manually, but apparently sometimes it's not called at runtime (?)
     
  36. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Seems like it was a weird legacy material on my seaweed, changed to standard and it got past there, still reports 3000 float overflow errors but its doing something now.. fingers crossed!..
     
  37. haltor

    haltor

    Joined:
    May 22, 2017
    Posts:
    4
    [QUOTE="
    I'm not currently sure why it happens in the first place, BUT if you call

    DynamicGI.UpdateEnvironment();

    It should fix itself. The prefiltered skybox probe is buried somewhere in the LightingData asset with no API, so the best I can do is to call this function manually, but apparently sometimes it's not called at runtime (?)[/QUOTE]

    That worked! Thank you very much.
     
    guycalledfrank likes this.
  38. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Side note, if by chance there is no mesh assigned to a mesh filter within a gameobject using a bakery area light, unity throws an exception and bakery breaks:

    NullReferenceException: Object reference not set to an instance of an object
    ftBuildLights.BuildLight (.BakeryLightMesh obj, Int32 SAMPLES, System.String outName) (at Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs:266)
    ftRenderLightmap+<RenderLMDirect>c__Iterator3.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4918)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3416)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2549)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)

    [edit] Hmm.. I removed the bakery light mesh component, the mesh filter, then reapplied the bakery light mesh, rebaked, and now I'm getting this:

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[System.Int32,System.Int32].get_Item (Int32 key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    ftUniqueIDRegistry.GetUID (Int32 instanceId) (at Assets/Bakery/ftUniqueIDRegistry.cs:42)
    ftRenderLightmap.GetID (UnityEngine.Object obj) (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4486)
    ftRenderLightmap.GetLightName (UnityEngine.GameObject obj, Int32 lmid) (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4491)
    ftRenderLightmap+<RenderLMDirect>c__Iterator3.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4920)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3416)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2549)
     
  39. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I cant seem to work this out, I figured it was "seaweed" causing issues so I made it standard, but maybe it was nothing to do with that, its just the last one on the list before everyone crashes. After that it talks about unloading assets so it seems like it should work but then it just gets stuck in a constant loop of float overflows.

    So when I render I get :

    2 error dialogs:
    "null txt ptr",
    "null emission txt ptr"

    then it survives for another 15 mins and rapidly runs out of memory and hangs unity, the log shows:

    Alpha 472: Roadsign_1
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    SimpleLogChannels.SLCLogHandler:LogFormat(LogType, Object, String, Object[]) (at Assets\_RelativeMotion\SimpleLogChannels\Scripts\SLCLogHandler.cs:65)
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    <ExportScene>c__Iterator0:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:3351)
    <RenderLightmapFunc>c__Iterator2:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2886)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2549)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:191)
    (Filename: Assets/_RelativeMotion/SimpleLogChannels/Scripts/SLCLogHandler.cs Line: 65)
    Alpha 473: metal_barrier
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    SimpleLogChannels.SLCLogHandler:LogFormat(LogType, Object, String, Object[]) (at Assets\_RelativeMotion\SimpleLogChannels\Scripts\SLCLogHandler.cs:65)
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    <ExportScene>c__Iterator0:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:3351)
    <RenderLightmapFunc>c__Iterator2:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2886)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2549)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:191)
    (Filename: Assets/_RelativeMotion/SimpleLogChannels/Scripts/SLCLogHandler.cs Line: 65)
    Alpha 474: seaweed
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    SimpleLogChannels.SLCLogHandler:LogFormat(LogType, Object, String, Object[]) (at Assets\_RelativeMotion\SimpleLogChannels\Scripts\SLCLogHandler.cs:65)
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    <ExportScene>c__Iterator0:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:3351)
    <RenderLightmapFunc>c__Iterator2:MoveNext() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2886)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets\Editor\x64\Bakery\scripts\ftRenderLightmap.cs:2549)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at C:\buildslave\unity\build\Editor\Mono\EditorApplication.cs:191)
    (Filename: Assets/_RelativeMotion/SimpleLogChannels/Scripts/SLCLogHandler.cs Line: 65)
    Unloading 1266 Unused Serialized files (Serialized files now loaded: 0)
    System memory in use before: 9.53 GB.
    System memory in use after: 9.49 GB.
    Unloading 3916 unused Assets to reduce memory usage. Loaded Objects now: 862101.
    Total: 819.105816 ms (FindLiveObjects: 100.115840 ms CreateObjectMapping: 90.509939 ms MarkObjects: 623.953438 ms DeleteObjects: 4.525573 ms)
    Float overflow
    0x000000014153B688 (Unity) StackWalker::GetCurrentCallstack
    0x0000000141541BC6 (Unity) StackWalker::ShowCallstack
    0x0000000141410F5B (Unity) GetStacktrace
    0x00000001408B1E60 (Unity) DebugStringToFile
    0x00000001418E09C8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000000007526F980 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x000000007526F853 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526D22D (Mono JIT Code) [SLCLogHandler.cs:66] SimpleLogChannels.SLCLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526C991 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000000000E23D89D (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    0x000000000E30E99B (Mono JIT Code) [ftBuildGraphics.cs:423] ftBuildGraphics:exportVBTraceTexAttribs (System.Collections.Generic.List`1<single>,System.Collections.Generic.List`1<single>,UnityEngine.Vector3[],UnityEngine.Vector3[],UnityEngine.Vector2[],int,bool)
    0x000000000E296073 (Mono JIT Code) [ftBuildGraphics.cs:3618] ftBuildGraphics/<ExportScene>c__Iterator0:MoveNext ()
    0x000000000E1E5F1D (Mono JIT Code) [ftRenderLightmap.cs:2886] ftRenderLightmap/<RenderLightmapFunc>c__Iterator2:MoveNext ()
    0x000000000E17ED56 (Mono JIT Code) [ftRenderLightmap.cs:2549] ftRenderLightmap:RenderLightmapUpdate ()
    0x000000006777DAF7 (Mono JIT Code) (wrapper delegate-invoke) <Module>:invoke_void ()
    0x0000000067795F87 (Mono JIT Code) [EditorApplication.cs:191] UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    0x000000007523A8C5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FF8563FA69B ((<unknown>))
    0x00007FF856381BB2 ((<unknown>))
    0x00007FF85638AB9F ((<unknown>))
    0x0000000140BFDF47 (Unity) CallStaticMonoMethod
    0x0000000140BFDCCE (Unity) CallStaticMonoMethod
    0x00000001413E24D3 (Unity) SceneTracker::Update
    0x000000014144E2C8 (Unity) Application::TickTimer
    0x00000001415EDDA5 (Unity) MainMessageLoop
    0x00000001415F0198 (Unity) WinMain
    0x0000000142434B9A (Unity) __scrt_common_main_seh
    0x00007FF898661FE4 (KERNEL32) BaseThreadInitThunk
    0x00007FF89892F061 (ntdll) RtlUserThreadStart
    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)
    Float overflow
    0x000000014153B688 (Unity) StackWalker::GetCurrentCallstack
    0x0000000141541BC6 (Unity) StackWalker::ShowCallstack
    0x0000000141410F5B (Unity) GetStacktrace
    0x00000001408B1E60 (Unity) DebugStringToFile
    0x00000001418E09C8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000000007526F980 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x000000007526F853 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526D22D (Mono JIT Code) [SLCLogHandler.cs:66] SimpleLogChannels.SLCLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526C991 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000000000E23D89D (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    0x000000000E30E99B (Mono JIT Code) [ftBuildGraphics.cs:423] ftBuildGraphics:exportVBTraceTexAttribs (System.Collections.Generic.List`1<single>,System.Collections.Generic.List`1<single>,UnityEngine.Vector3[],UnityEngine.Vector3[],UnityEngine.Vector2[],int,bool)
    0x000000000E296073 (Mono JIT Code) [ftBuildGraphics.cs:3618] ftBuildGraphics/<ExportScene>c__Iterator0:MoveNext ()
    0x000000000E1E5F1D (Mono JIT Code) [ftRenderLightmap.cs:2886] ftRenderLightmap/<RenderLightmapFunc>c__Iterator2:MoveNext ()
    0x000000000E17ED56 (Mono JIT Code) [ftRenderLightmap.cs:2549] ftRenderLightmap:RenderLightmapUpdate ()
    0x000000006777DAF7 (Mono JIT Code) (wrapper delegate-invoke) <Module>:invoke_void ()
    0x0000000067795F87 (Mono JIT Code) [EditorApplication.cs:191] UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    0x000000007523A8C5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FF8563FA69B ((<unknown>))
    0x00007FF856381BB2 ((<unknown>))
    0x00007FF85638AB9F ((<unknown>))
    0x0000000140BFDF47 (Unity) CallStaticMonoMethod
    0x0000000140BFDCCE (Unity) CallStaticMonoMethod
    0x00000001413E24D3 (Unity) SceneTracker::Update
    0x000000014144E2C8 (Unity) Application::TickTimer
    0x00000001415EDDA5 (Unity) MainMessageLoop
    0x00000001415F0198 (Unity) WinMain
    0x0000000142434B9A (Unity) __scrt_common_main_seh
    0x00007FF898661FE4 (KERNEL32) BaseThreadInitThunk
    0x00007FF89892F061 (ntdll) RtlUserThreadStart
    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)
    Float overflow
    0x000000014153B688 (Unity) StackWalker::GetCurrentCallstack
    0x0000000141541BC6 (Unity) StackWalker::ShowCallstack
    0x0000000141410F5B (Unity) GetStacktrace
    0x00000001408B1E60 (Unity) DebugStringToFile
    0x00000001418E09C8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000000007526F980 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x000000007526F853 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526D22D (Mono JIT Code) [SLCLogHandler.cs:66] SimpleLogChannels.SLCLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526C991 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000000000E23D89D (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    0x000000000E30E99B (Mono JIT Code) [ftBuildGraphics.cs:423] ftBuildGraphics:exportVBTraceTexAttribs (System.Collections.Generic.List`1<single>,System.Collections.Generic.List`1<single>,UnityEngine.Vector3[],UnityEngine.Vector3[],UnityEngine.Vector2[],int,bool)
    0x000000000E296073 (Mono JIT Code) [ftBuildGraphics.cs:3618] ftBuildGraphics/<ExportScene>c__Iterator0:MoveNext ()
    0x000000000E1E5F1D (Mono JIT Code) [ftRenderLightmap.cs:2886] ftRenderLightmap/<RenderLightmapFunc>c__Iterator2:MoveNext ()
    0x000000000E17ED56 (Mono JIT Code) [ftRenderLightmap.cs:2549] ftRenderLightmap:RenderLightmapUpdate ()
    0x000000006777DAF7 (Mono JIT Code) (wrapper delegate-invoke) <Module>:invoke_void ()
    0x0000000067795F87 (Mono JIT Code) [EditorApplication.cs:191] UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    0x000000007523A8C5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FF8563FA69B ((<unknown>))
    0x00007FF856381BB2 ((<unknown>))
    0x00007FF85638AB9F ((<unknown>))
    0x0000000140BFDF47 (Unity) CallStaticMonoMethod
    0x0000000140BFDCCE (Unity) CallStaticMonoMethod
    0x00000001413E24D3 (Unity) SceneTracker::Update
    0x000000014144E2C8 (Unity) Application::TickTimer
    0x00000001415EDDA5 (Unity) MainMessageLoop
    0x00000001415F0198 (Unity) WinMain
    0x0000000142434B9A (Unity) __scrt_common_main_seh
    0x00007FF898661FE4 (KERNEL32) BaseThreadInitThunk
    0x00007FF89892F061 (ntdll) RtlUserThreadStart
    (Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)
    Float overflow
    0x000000014153B688 (Unity) StackWalker::GetCurrentCallstack
    0x0000000141541BC6 (Unity) StackWalker::ShowCallstack
    0x0000000141410F5B (Unity) GetStacktrace
    0x00000001408B1E60 (Unity) DebugStringToFile
    0x00000001418E09C8 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000000007526F980 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x000000007526F853 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526D22D (Mono JIT Code) [SLCLogHandler.cs:66] SimpleLogChannels.SLCLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000007526C991 (Mono JIT Code) [Logger.cs:48] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000000000E23D89D (Mono JIT Code) [Debug.bindings.cs:117] UnityEngine.Debug:LogError (object)
    0x000000000E30E99B (Mono JIT Code) [ftBuildGraphics.cs:423] ftBuildGraphics:exportVBTraceTexAttribs (System.Collections.Generic.List`1<single>,System.Collections.Generic.List`1<single>,UnityEngine.Vector3[],UnityEngine.Vector3[],UnityEngine.Vector2[],int,bool)
    0x000000000E296073 (Mono JIT Code) [ftBuildGraphics.cs:3618] ftBuildGraphics/<ExportScene>c__Iterator0:MoveNext ()
    0x000000000E1E5F1D (Mono JIT Code) [ftRenderLightmap.cs:2886] ftRenderLightmap/<RenderLightmapFunc>c__Iterator2:MoveNext ()
    0x000000000E17ED56 (Mono JIT Code) [ftRenderLightmap.cs:2549] ftRenderLightmap:RenderLightmapUpdate ()
    0x000000006777DAF7 (Mono JIT Code) (wrapper delegate-invoke) <Module>:invoke_void ()
    0x0000000067795F87 (Mono JIT Code) [EditorApplication.cs:191] UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
    0x000000007523A8C5 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    0x00007FF8563FA69B ((<unknown>))
    0x00007FF856381BB2 ((<unknown>))
    0x00007FF85638AB9F ((<unknown>))
    0x0000000140BFDF47 (Unity) CallStaticMonoMethod
    0x0000000140BFDCCE (Unity) CallStaticMonoMethod
    0x00000001413E24D3 (Unity) SceneTracker::Update
    0x000000014144E2C8 (Unity) Application::TickTimer
    0x00000001415EDDA5 (Unity) MainMessageLoop
    0x00000001415F0198 (Unity) WinMain
    0x0000000142434B9A (Unity) __scrt_common_main_seh
    0x00007FF898661FE4 (KERNEL32) BaseThreadInitThunk
    0x00007FF89892F061 (ntdll) RtlUserThreadStart


    Im going to try tile size 256 and lower texels. Lightmapping hell once again, thought Id side stepped this when I found this asset :(
     
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Fixed it already :) I can send you a patch.

    Can be an out-of-memory problem. Can only happen if GetNativeTexturePtr() of a valid texture returns null. There is no information in Unity docs why it can happen, so I can only guess.

    Float overflows: can you isolate a small part of the scene that causes it?

    Also: float overflows are warnings, everything except GI will work anyway (GI may produce some artifacts though). Perhaps the printing of the error is what gets you stuck?... In which case, can you try just removing
    Debug.LogError("Float overflow")

    from ftRenderLightmap.cs?
     
    Last edited: Dec 4, 2018
  41. samdpt

    samdpt

    Joined:
    Oct 1, 2018
    Posts:
    14
    Hey @guycalledfrank - do you know what would cause colored pixels from a light render? Like screen below.

    I'm using an HDR cubemap, I lowered resolution to 256 like you recommended. Do you have a general workflow for how you work with HDR lighting using Bakery?

    Thanks!
     

    Attached Files:

  42. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    "float overflow" is not in that file - where is it? (edit its in ftBuildGraphics) Cant you code it to avoid this? Also it surely isnt a debug.log problem, you must have some other clue ? I will try narrowing down but im getting sick as a dog doing this, wasting weeks and weeks. Why cant you simply code meaninful error messages? And let us know what its doing before it crashes???
     
  43. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Yes. Things like this are caused by texture compression. You can select lightmap texture assets and tweak their compression settings.

    Nobody was supposed to hit that error and you're probably the first. Sorry about that. I don't have any other clues unfortunately. You can:
    - Send me the project for debugging (possibly stripped down to a bare minimum).
    - Or just get a refund.
     
  44. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Well I will try hacking in proper error messages to see whats causing it first (may I suggest you release new version with many output messages so people can pinpoint which thing causes issue, you say people arent meant to hit the error, but clearly they are or it wouldnt be an exception which gets caught, any potential error will happen as you know-and how difficult would it be to print the offending objects name, or even bail before stealing all ram). Can't send project its 300 gigs, and refund, well yeah if all else fails. I would like this to work though, and this scene probably is the ultimate test. Its hard to explain my anger, I have spent 24 months on lightmapping, so at this point I am just ready to give up, but I keep wondering if Bakery can actually do the job, nothing else can seemingly.

    Unity really is not designed for huge games it seems, and lightmapping a huge scene is seemingly impossible. Its not even that big, anyway I will keep relentlessly trying..... I think most of my negativity is aimed at unity and im trying to be positive but when a bake works one monday and not the next it gets hellish.

    edit: for example - preparing, it could print what its doing, it gets right up to 32 gig and I have no idea what its doing, maybe some crazy model is causing issues. If it hits 32, game over pc needs to be turned off.
     
    Last edited: Dec 4, 2018
    guycalledfrank likes this.
  45. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    I know how you feel - I spent some furious night before with not-that-big-scenes (and oh boy it was also back when Unity had a 32-bit only editor...).

    If you can replace the float overflow debug log with at least
    Debug.LogError("Float overflow: " + lmid + " " + u);

    It might give some hints.
     
    Mark_01 and radiantboy like this.
  46. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Seems like a problem with your shader. I don't really recognize these keywords.
    Let me do a double check where the problem is coming from.

    Any errors during the process?

    No, no info in the console. What happens is: there is like a proces baking the probes, and then finishes, but nothing happens, if i check the occluded probes checkbox, then i see how the lightmapper goes through every probe now actually doing the baking. With no occlusion probe check box, if i select a static mesh, there ano no thetaedrons of the probes visible, with occlusion probes check box active, then the tetrahedrons are visible and working.

    Now, i see something weird with lightmaps in runtime:
    this is how they look in editor normaly:
    upload_2018-12-4_19-23-38.png

    And this is how they look in play mode:
    upload_2018-12-4_19-24-5.png

    In both scenes i have the baked lightmap viewport active.

    there is even a an offset in the lightmap, can be seen here:
    upload_2018-12-4_19-28-16.png
    upload_2018-12-4_19-28-37.png


    EDIT: Apparently, that is just an error of the "Baked Lightmap" viewport, since in game and "shaded" viewport the lightmaps looks ok.
     
    Last edited: Dec 5, 2018
  47. aeldred28

    aeldred28

    Joined:
    Dec 16, 2017
    Posts:
    30
    Is it possible or sensible to implement options for changing the intensity of color in light bounces? Like how strong an impact color has on GI? I feel that my bakes sometimes dont have enough intense color when two perpendicular planes meet, but I don't know if thats just a limitation of unity baking or not.
     
  48. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,755
    It's a Unity bug, it happens with the built in lightmappers as well.
     
    Loards likes this.
  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    And just to elaborate, what kinds of suspicious things I would expect to see:
    - Unusually high lmid value (> 100?)
    - Weird u value (very high, NaN, Infinity)
    Some of these can be clues.
    BTW feel free to contact me via PM or even skype (same as nickname), I usually respond quicker there :)

    Weird. Can you make a snapshot of a last few console messages after it finishes?
    BTW does lightprobe baking work in example scenes (e.g. example_shadowmask or example_sponza_*)?

    Huh. That might be the answer. Haven't seen it before.

    Yeah, you can totally do that. A physically-correct way would be to increase light intensity and material brightness, so bounces naturally become more pronounced, then possibly use tonemapping to compress overly bright areas.
    A non-physical but quick option is to change "Indirect Intensity" on the light, it will just scale the intensity of bounces caused by this particular source.
     
  50. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Is it just me or is Bakery not marking the baked lights as baked?
    I'm baking a spot light (set to baked mode) and once it's done baking, the light is still on in realtime + the baked maps.
    I have to manually turn off the light or manually set it as "baked" using the debug mode of the inspector. (this property is not exposed)
    Shouldn't Bakery mark all the baked lights as "baked" automatically once the render is done?