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. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Really need directional lightmaps support, please, say when this feature realesing?
     
  2. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Soon. Maybe in a month. Currently working on GI from custom shaders support, as that's the most frequently asked feature (also fixing bugs and supporting people). Just stay tuned for now :)
     
    recon0303 and YouDesign like this.
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Sure, but you still have to wait though. May be you will consider than adding part tracing ( brute force method ) at some point later with live update ( as PLM ) - and rely on the denoiser still to clean up lightmaps !?
    You think that's possible for future releases eventually !?
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Unlikely, it's like writing a second independent lightmapper. Don't forget you can group objects to lightmap groups and use Render Selected.
    Or how about using Progressive for preview and Bakery for production? You can make them match apart from features Progressive doesn't support (different falloff, IES, etc)
     
  5. Archviz3d

    Archviz3d

    Joined:
    Apr 4, 2016
    Posts:
    92
    Hi!!!

    You asset seems really awesome !!! Does it support multi- gpu for baking? Or do you plan to support it in the future? Thanks!
     
    guycalledfrank likes this.
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    CUDA itself should be able to run in parallel on multiple GPUs, but I didn't test (I only have one). I would be surprised if it doesn't work.
     
    Archviz3d likes this.
  7. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Hi, I'm interested in this asset. But I seen a review that someone had stated that it don;t work with normal maps? I know reviews can be nonsense. But I wanted to ask. Maybe its a bug? Anyways I wanted to know before I bought this. Thanks,!


    Never mind I see its being worked on, for Directional lighting.

    Thanks, I will wait for this release. as this is super important.
     
  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Yeah, the review is correct. Directional lightmaps are being implemented, but they are not there yet, so maybe wait a bit.
     
    recon0303 likes this.
  9. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    122
    This looks fantastic! Although I have a few questions. Is there an ETA for shadowmask mixed lighting, directional lightmaps, and LOD support?

    Also, I'm not very knowledgeable in this area, but how does LOD work with lighting currently? Do lower level LOD models use the baked light probes for some lighting info? When you say this asset will eventually support LOD do you mean the baking process with create lightmaps for the lower level LODs as well?
     
    guycalledfrank likes this.
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    I would expect all these to be done in 2-3 months. I'm currently working full-time on the lightmapper, so should be doable, but I also need to support users and fix bugs.

    Currently it's a bit dumb. Lightmapper just sees all LODs at the same time. and they all cast shadows onto each other.

    Yes. My idea of LOD support is having independent lightmap per LOD level.
     
    ekergraphics, RPowers and Mark_01 like this.
  11. psych77

    psych77

    Joined:
    Mar 1, 2017
    Posts:
    55
    Hi i geting an error, any idea?

    Error Exporting scene and then this:

    NullReferenceException: Object reference not set to an instance of an object
    ftBuildGraphics.ModelUVsOverlap (UnityEditor.ModelImporter importer, ftLightmapsStorage[] storages) (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:577)
    ftBuildGraphics+<ExportScene>c__Iterator0.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:2090)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1493)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1404)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)

    Also strangely if i try to bake in the demo scene my editor crashes hmm.
     
    Last edited: Aug 6, 2018
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Yeah seems like this is what Jimbobalubob fixed here.

    ... that shouldn't happen. Even example_lights? How much RAM and VRAM do you have?
     
  13. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,115
    Hi, does this support HDRP?
     
  14. psych77

    psych77

    Joined:
    Mar 1, 2017
    Posts:
    55
    16GB and 6gbvram on my GTX 980 Ti.

    Also getting a ftrace error 500..

    Error: 500
    UnityEngine.Debug:Log(Object)
    <RenderLightmapFunc>c__Iterator2:MoveNext() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2110)
    ftRenderLightmap:RenderLightmapUpdate() (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1404)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Untested. Maybe.

    On example scenes? Your system sounds good to me.
    Error 500 sounds like it failed to load scene files. Are there any account restrictions on your system? Try running Unity as admin?
     
  16. psych77

    psych77

    Joined:
    Mar 1, 2017
    Posts:
    55
    hehe now i get this after running as admin:


    NullReferenceException: Object reference not set to an instance of an object
    ftBuildGraphics+<ExportScene>c__Iterator0.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:2012)
     
  17. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Which scene?
    Also which Unity version?
     
  18. psych77

    psych77

    Joined:
    Mar 1, 2017
    Posts:
    55
    One of my own. In your scene i crash to desktop if i try to bake strangely. Could i be that im using Unity 2018.2.1f1?
     
  19. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    I'm downloading 2018.2 now to see. The last version I tested it on was 2018.1.
     
  20. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,115
    Could you check though? I know HDRP is still WIP, but would like to know if this is possible before I buy. I wouldn't want to bug you after purchase.

    Much appreciated.
     
  21. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    I have trouble with double-side shaders, like this - https://gist.github.com/naojitaniguchi/62ccf37c801ea55517b7

    Lighmaps have some black polygons on objects with same shaders. I think lighmapper ignored polygon without normals. Its can fixing? May be you test some two-side shaders and include it in future release?
     
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Just tested, works fine.There must be something weird with your system/setup/something. Can you contact me privately by email (see on assetstore page) to not spam the thread? I might need to ask you to do some tests, and we'll figure that out.

    Testing right now.

    So the first thing I noticed is that Unity's own Standard shader fails to compile in a HDRP project. So all example projects are pink.
    Replacing Standard with HDRenderPipeline/Lit fixes the issue. Materials need to be set up from scratch, because texture names between Standard and Lit don't match (why did they do that...?).

    Lightmapping works! BUT because HDRP shaders have different parameter names, it doesn't pick up albedo/opacity/emissive correctly. That should be fixed after I add proper support for custom shaders.

    They aren't going to work well with any lightmapper, because they all only bake one side.
     
    Mark_01 likes this.
  23. psych77

    psych77

    Joined:
    Mar 1, 2017
    Posts:
    55
    Ok thanks man :)
     
  24. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    Hi guycalledfrank,

    I've run into an issue with Bakery, and I'm hoping you might be able to help.

    When I create a fresh empty Unity project with nothing but Bakery imported, I can bake the Sponza example scene no problem, but when I import Bakery into my current game project, and then try to bake the Sponza example scene, I get the following error:

    Win32Exception: ApplicationName='Assets/Editor/x64/Bakery/ies2tex.exe', CommandLine='"C:/Users/jason/Documents/WIP/Game2/Unity/Game2/Assets/../Assets/Bakery/examples/content/AreaLight.ies" cookie281510069.dds 1', CurrentDirectory='C:\Users\jason\AppData\Local\Temp\frender', Native error= %1 is not a valid Win32 application.

    System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
    System.Diagnostics.Process.Start () (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
    (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
    ftBuildLights.BuildLight (BakeryPointLight obj, System.Int32 SAMPLES, System.Boolean texDirty, System.Boolean ignoreNormal, System.String outName) (at Assets/Editor/x64/Bakery/scripts/ftBuildLights.cs:404)
    ftRenderLightmap+<RenderLMDirect>c__Iterator3.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:2782)
    ftRenderLightmap+<RenderLightmapFunc>c__Iterator2.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1811)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:1404)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:191)

    I've tried removing Bakery from my project and re-importing it. I've also tried manually installing it by copying over the relevant Bakery folders from a fresh blank Unity project with only Bakery installed. Nothing seems to help. I keep getting the same error.

    Any idea what might be going on?

    Thanks in advance for your help. Great work with Bakery. -- Aside from this issue, I'm loving it so far!!

    : )

    J
     
  25. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    OK, so I figured out what the problem was. My project is set up for iOS and the Scripting Runtime Version was set to .NET 4.x Equivalent. I switched it back to .NET 3.5 Equivalent and now Bakery works just fine.

    Thank you for making Bakery! Excellent work!! Love it!!!

    : )

    J
     
  26. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    It looks like my original post/question is waiting for some sort of moderator approval. As a result, my recent post probably doesn't make much sense. Long story short, Bakery wasn't working for me. It was throwing an error when trying to run the ies2tex application: "not a valid Win32 application"
     
  27. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Good news: I've just fixed .NET 4.6 compatibility issues.
    There are now so many little fixes since 1.0, I'm thinking of updating the package to 1.05 tomorrow :)
     
    Mark_01, Archviz3d and AcidArrow like this.
  28. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    Awesome!

    One more question: Does Bakery support Distance Shadowmasks? -- Doesn't seem to be working here for me.

    Thanks!
     
  29. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    It's work in progress, together with directional lightmaps.
     
    Archviz3d likes this.
  30. Archviz3d

    Archviz3d

    Joined:
    Apr 4, 2016
    Posts:
    92
    Thats awesome!!! Have to try it ;-)
     
    guycalledfrank likes this.
  31. BPR

    BPR

    Joined:
    Jan 4, 2013
    Posts:
    56
    Baking Lightprobes freezes my project btw.
    Or its just taking so much longer than baking the actual lightmap.
    Shut down the editor after 10 mins or so..
    No error message
    upload_2018-8-7_12-21-57.png
     
  32. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347

    Will it be possible to uniquely bake the floor lightmap without having to (temporarily) bake "unimportant" objects in a future release?
     
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    I'm just preparing 1.05 for the release right now. There are many lightprobe related fixes.
    In your particular case it might be caused by Realtime Reflection Probes being disabled in Quality settings. You can try enabling them as a quick workaround, but it won't be necessary in 1.05.

    Yeah. Not in 1.05, but soon enough.
     
    Mark_01 and Cascho01 like this.
  34. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sounds very nice, but I forgot to mention that I mean to bake including GI from unimportant objects.... - sorry
     
  35. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Given your previous posts I realize that :). Without GI it's already possible.
     
    Cascho01 likes this.
  36. BPR

    BPR

    Joined:
    Jan 4, 2013
    Posts:
    56
    Yes that fixed it :) Looking forward to 1.05

    Kind regards
     
    guycalledfrank likes this.
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Argh, now it seems like for every version we need to wait for store approval! I only hope that it won't take as long as the initial upload.

    But anyway, 1.05 was submitted.
    Changelog:

    - Added vertex baking.
    - Added "Update Skybox Probe" button.
    - Added output folder option.
    - Added texture type option.
    - Improved atlas packing in some cases.
    - Fixed multi-scene terrain baking.
    - Fixed .NET 4.6 compatibility.
    - Fixed possible NullReferenceException on scene export.
    - Fixed light probe render sometimes messing up lightmap coordinates.
    - Fixed rendering light probes for a huge number of open scenes.
    - Fixed light probes not rendering when "Realtime reflection probes" was disabled in quality settings.
    - Fixed temp folder path not being saved.

    Thanks to all users who were reporting bugs (and sometimes even their solutions) for this release.

    review.jpg
     
  38. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    A couple of days for already existing packs. May take a couple more because is a "new" package but still around a few days for approval now !
     
    Mark_01 and guycalledfrank like this.
  39. DebugLogError

    DebugLogError

    Joined:
    Jul 24, 2013
    Posts:
    57
    @guycalledfrank Is it possible to bake lighting within a build? I have seen your other responses saying it should not be used for runtime - but neither the bake time or Nvidia requirements are an issue in my case.
     
  40. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    Super! -- Thanks!!
     
    guycalledfrank likes this.
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    On top of bake time and Nvidia you may also need a few spare gigabytes for temporary data during bake. If that's OK for you, then it's possible. Existing scripts do a lot of stuff and use UnityEditor namespace, but a runtime one can be made. Asset importing should be then replaced by parsing textures at runtime, and because GameObject static flags don't exist in builds, you would have to filter objects differently.
     
    DebugLogError likes this.
  42. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    To me the top priorities are:
    directional ligthmaps-> Discovered this reading asset reviews, this was a deal breaker to me.
    shadowmask support-> I was going to get asset even I knew this was not supported and simply solve meanwhile with a projector and proves for player's vehicle.
    I'll keep watching progress, TBH I'm excited after all.
     
    YouDesign and guycalledfrank like this.
  43. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    1.05 is released! :)

    One note: I added texture type option to Advanced settings (called Encoding), and it has 2 modes - "Mobile" and "PC". It actually only switches Texture Type on lightmap assets (Lightmap and Default).
    In 1.05 default mode is "Mobile", but you may want to switch it to "PC", because on some Unity versions (at least 5.6) setting texture type to Lightmap actually produces worse quality comparing to Default.

    upload_2018-8-8_21-14-16.png
     
    Mark_01 and TooManySugar like this.
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Baking global illumination from custom shaders is almost working :)


    ftCustomShaderGI2.jpg
     
    colin299, CoastKid, Gametyme and 2 others like this.
  45. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Thanks for new release! Can you help modify new vertex lighmap shader for double-side view? This method very useful for bake lightmaps on trees and plants, but many models use one-side geometry and without double-side shader looks bad.
     
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Just rendering both sides is easy - add Cull Off. But to have different baked lighting on different sides it's not enough, you'll need real double-sided geometry.
    On my tree screenshots I cheated a bit: all leaves have just one side that looks up and Cull Off. Lighting is only baked on one side (where the light is most likely to come from) Then I used SV_IsFrontFace to determine back faces and simply darkened them a bit.

    Edit: Seems like VFACE should also work but I remember I had problems with it in older Unity versions.
     
  47. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    648
    Sorry, but I'm a bit unclear. When you say this is not a Real Time GI solution ... do you mean ala SEGI, or do you mean the "Realtime Lighting" in the Lighting editor for baking the GI?

    I'm using real time lighting and the global illumination from Unity. If this would speed up the process of that bake (and not require any changes to how I make my scene), I'd be happy to pick this up.

    Best of luck with this. I HATE baking lighting ... which is one reason I'm going with realtime right now. If you get this up to par with the built in stuff (directional lightmaps, shadowmask lighting mode), and it just works "as is" with my game, then I'll be interested in trying this out.

    Also, do you support multiple GPUs? I have a 1080 and two 960s just waiting to be used by this :).
     
  48. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Both. Enlighten's realtime GI is a very special technology and basically its most important selling point. It's not supported nor by Progressive, neither by Bakery.
    But you can combine realtime lights with baked GI, only it's static.

    It should be working, but nobody tested that so far.
     
    Last edited: Aug 9, 2018
  49. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I like this, I've trees I would preffer not to bake but I would like their effect to be noticed on teh floor. Something like "lightmap caster" "affect lightmap"option. I've read the answer of the scale lightmap and grouping lightmaps etc.. bit clunky. Hope you can find out something easyer. But not a priority tho.
     
    Last edited: Aug 9, 2018
    Cascho01 and guycalledfrank like this.
  50. NeilC

    NeilC

    Joined:
    Mar 20, 2014
    Posts:
    3
    Just to let you know, I have a 1080ti and a 980GTX in the same box, and both show 100% usage while baking.
     
    ArchVizPRO, Mark_01, DGordon and 2 others like this.