Search Unity

Bakery - GPU Lightmapper (v1.6) [RELEASED]

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

  1. RaulBarbosaTFGco

    RaulBarbosaTFGco

    Joined:
    Nov 14, 2018
    Posts:
    1
    Hi there,
    I am just running through a problem with tiled textures.
    When I use tiled textures with alphas of any kind (e.g cut out, transparency) the baking process do not count that as a tiled one, and instead, it bakes the light as the object have just one tile.

    Any thoughts about where or how to fix it?

    thanks a lot


    ps: I tested with full lighting mode and shadowmask
    upload_2019-8-14_18-1-10.png
     
  2. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    332
    Fyi. Kind of christmas day.
    Virtual texturing seems landed in SRP's.

    GraphineCharles did some work
    https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4147

    and the SRP VirtualTexturing branch

    https://github.com/Unity-Technologies/ScriptableRenderPipeline/commits/VirtualTexturing

    There was some merge activitys in HDRP 7.1.0 Unity 2019.3.
    All i hope i custom Lightmap virtualisation will be possible easily.

    Please have a eye on that.)
    Real crazy stuff becomes possible when we could virtualize
    Lightmaps too.

    Bakery HDRP SH Directional where all PBR textures + all 4 HDRLightmaps could be virtualized completly is all i dream on.

    As example here an old 8K RGBA (BC6H was not implemented) Lightmap with RT AO in Alpha.(square on screenshot is an detail zoom)
    Here an older Unity Granite scenario with an car interior has 15 x 8k lightmaps + 4k detail normals virtualized with simple reflection occlusion through lightmap alpha.
    Runs even on Android and withVR hell of detail and fps.
    You simpy need not take care much about texture memory or compression.
     

    Attached Files:

    Last edited: Aug 23, 2019
    guycalledfrank likes this.
  3. luellasfpg

    luellasfpg

    Joined:
    Jan 23, 2019
    Posts:
    16
    Hey, so our team is running into issues where we are getting the following Bakery related warning errors in a scene:

    The referenced script (Unknown) on this Behaviour is missing!
    The referenced script on this Behaviour (Game Object '!ftraceLightmaps') is missing!
    But the thing is, we don't have Bakery installed in this project. The scene was originally imported from a project that used Bakery generated lightmaps, but we deleted them ("clear baked data" in lighting settings) and also deleted all gameobjects from the scene, but it still gives this error. The error only went away after we moved all the gameobjects into a new scene.

    My question is, how can we completely clear Bakery related elements in a scene and from our project moving forward? (We're trying to narrow down a bug that crashes our headless server so everything we can cross out and clear from the scene is helpful). Thanks.
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Just my observations. Non-HQ compression for shadowmasks and SH maps looked very poor. ETC compression on Android is especially bad, HQ can make it look slightly better.
    I should probably make it an option.

    How large is large? For some scenarios lightmapping might be just a wrong tool.
    If you're going out of mem on GI, try enabling GI VRAM optimization. If you have terrains, make sure Terrain optimization is active.

    Gimme a few days and I'll update the repo.

    Mipmaps aren't very suitable for lightmaps, see: https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#mipmapping

    The Witness just swapped geometric LODs together with lightmaps: http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/#comment-1090

    You can try it of course. See ftTextureProcessor.cs (importer.mipmapEnabled = false).

    Yup, see this: https://geom.io/bakery/wiki/index.php?title=Manual#Opacity
    Bakery does not apply any shader-based modifications to alpha values, only uses textures and mesh UVs as is. This is to preserve full opacity map detail without moving it to meta pass like albedo and emission. Although I can try to add support directly for _MainTex tiling/offset values to pre-transform geometry UVs with them.

    Weeeell, streaming is not magic. You're still paying with loading time ;) Streaming uncompressed textures will take way longer than compressed.

    I recommend doing "clear baked data" after closing Bakery window completely first.
    Since you're no longer have access to this button, you can just try executing this in Editor:
    DestroyImmediate(GameObject.Find("!ftraceLightmaps"))
     
    Mark_01 and sewy like this.
  5. BasenjiGames

    BasenjiGames

    Joined:
    Mar 13, 2014
    Posts:
    3
    It's maybe 4 million polys. At a resolution of 85 it completes in 6 hours fine. At the intended resolution of 100 it always has a memory error. VRam Optimization is on.
     
  6. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    That would be great. We compress with astc and there a 4k texture can take up to 10 minutes to compress. With a new set of lightmaps this can be horrible.

     
    guycalledfrank likes this.
  7. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    903
    Hi when you remove bakery from a project it seems a hidden object remain in the scene - ftraceLightmaps.
    How to remove this and prevent object to remain when bakery is removed ?
    Thanks !

    Awesome lightmaps quality btw !

    upload_2019-8-17_21-4-43.png
     
    guycalledfrank likes this.
  8. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    332
    Uncompressed for sure.

    When it s done like here it it becomes magic.
    All textures and all lightmaps are proper virtualized.
    Thats makes some nice hq details by constant graphic memory and drawcall optimisation possible.

    Really good read with lots of nice tricks.
    Merging //UE4/Dev-VT/ to //UE4/Dev-Rendering
    https://github.com/EpicGames/UnrealEngine/commit/354796606b52dcb49ff5fdd5cfc68e2281eb9423
    (Unreal source git access could be needed)
     
    Last edited: Aug 17, 2019
    guycalledfrank likes this.
  9. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    I wonder what kind of scene and GPU is it? I never baked anything that would take more than 2 hours so far. Arch viz? Feels like you're pushing the boundaries of your GPU. At which stage does it go out of memory? Can you send me your .ftracelog.txt?

    Oh. That's a lot. Yeah, I suggest replacing the value in ftTextureProcessor.cs for now.

    Thanks! I think Bakery window might recreate it even after you click "Clear baked data", so
    - Close Bakery window
    - Click Bakery->Clear baked data
    Should be enough.
    If you already deleted all scripts, try manually executing
    DestroyImmediate(GameObject.Find("!ftraceLightmaps"))


    TBH with high enough resolution I can't tell the difference between uncompressed and BC6H-compressed lightmap. Only on very low resolution where compression blocks start overlapping multiple charts, it becomes noticeable.
     
  10. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    332
    How small is small from your experience?
    On a archviz interior vt lightmap should always have enough resolution?
    Lightmaps on outside areas with far view and less presence on screen could get critical?

    All what i know from the past is that BlockCompression in generel always was an issue in VT.
    Somehow they seam to solved it
    with these helpers for compute shader BC texture compression...
    CompressBC1Block
    CompressBC1Block_SRGB
    CompressBC3Block
    CompressBC3Block_SRGB
    CompressBC4Block
    CompressBC5Block
    ....
    They are only used #if LIGHTMAP_VT_ENABLED

    However it seems to be the year of VT arrives. Finally.
    And i hope on Unity side they don t forget the lightmaps and implement an full virtualisation like the competitor.
     
    Last edited: Aug 18, 2019
  11. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    53
    Does anyone have any tips on finding overlapping shadowmasks where there's more than 4? Is there some tool I've missed for it?
     
  12. BasenjiGames

    BasenjiGames

    Joined:
    Mar 13, 2014
    Posts:
    3
    The scene is arch viz sort of, residential environment. Card is GeForce GTX 980 Ti, I believe it has 6 gb vRam. I don't think I have the log file anymore but I can send next time this happens. It crashes around the very end when progress says 99% but it's still doing GI calculations.
     
    guycalledfrank likes this.
  13. Hipfire_Kim

    Hipfire_Kim

    Joined:
    Oct 17, 2017
    Posts:
    4
    Hi there,

    I'm unable to bake reflection probes in a scene after baking it with Bakery without resetting the lighting. I tried searching earlier posts but didn't find an answer, sorry if I missed it and I'm asking same things again.
     
  14. Scarabay

    Scarabay

    Joined:
    Sep 7, 2013
    Posts:
    11
    Same happens to my scene when I try to bake light probes.
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Depends on UV map complexity. If you have tiny charts (< 16x16) packed close to each other, it can be a problem for compression.

    Hmm haven't heard of that. I was working on a flight sim around 6 years ago and wrote some virtual texturing solution for the terrain. Terrain consisted of 2+ GB texture data, but the sim only required about 120 MB. As a preprocess, terrain was split into a quadtree with DXT-compressed textures corresponding to each quad. Therefore at any given moment we only required a limited number of textures loaded. I had a pool of DXT textures and streamed/swapped them on the fly. Compression played a big role in quality (amount of hi-res textures you can have at any time) and latency (hey, it even played decently from a USB 2.0 stick).
    Might be a problem without any suitable spatial partitioning I guess. That's why I don't believe in one-fits-all solutions.

    If there are any overlapping shadowmasks, you will get this message (it wasn't always there, so make sure you're on the latest release):

    upload_2019-8-21_11-17-35.png

    Then if you stop and peek at the console, there should be messages like this:

    upload_2019-8-21_11-20-24.png

    Try modifying these lights to fix the overlaps.

    Interesting. Are you sure it's not the denoiser? If you can calculate first GI bounce, then it shouldn't be a problem for it to do any subsequent bounces.

    Did you try the "Render reflection probes" button inside Bakery window? It works exactly like built-in ones, but also makes sure that lighting is left untouched.
     
    keeponshading likes this.
  16. Crevecoeur

    Crevecoeur

    Joined:
    May 15, 2014
    Posts:
    6
    Hi guycalledfrank,

    Firstly, thanks for your great work on Bakery.
    I notice today that my realtime GI was not working on my built app but not problem in editor.
    I have done some researchs and found that ftRenderLightmaps.cs line 1631 "Lightmapping.realtimeGI = usesRealtimeGI;" is commented.
    So I have uncommented it, and my realtime GI now works in my build version of my app.

    I don't know if it is a normal behaviour, just want to inform you about that.
     
  17. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    Hi,

    It would be great to be able to bake at higher resolutions like 6k or 8k to reduce drawcalls on mobile vr. Even oculus advices to use higher resolutions to have less textures.
    Seems that these devices are good at handling these.
     
  18. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Hey Guy,

    I'm getting this crash every time I'm trying to bake Light Probes on my Bake Computer. This error used to appear sporadically but now I'm getting it every time. It doesn't finish the bake and it crashes Unity.

    What should I do?

    Oh, we also started using this asset https://assetstore.unity.com/packages/tools/utilities/autoprobe-105295 to layout the Light Probes in our scenes, I don't know if that's doing anything weird to Bakery. (I did some testing to see if Bakery worked with that asset and it worked, but now after stress testing it on a real scene it seems to be giving this error).

     
    Last edited: Aug 23, 2019
  19. tetto_green

    tetto_green

    Joined:
    Dec 22, 2015
    Posts:
    18
    Hey there!
    You've done a great lightmapper!
    I have a question: is there a way to make light mesh work with HDRP subsurface scattering? My seem acting weird, giving me unexpected green surface. Changing diffusion profile doesn't affect anything, mb I am doing something wrong?
     
    guycalledfrank likes this.
  20. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    355
    I've been testing Bakery in a separate project before I move over to it fully.

    1. What exactly is Bakery doing to the models in my project...adjusting UVs? I just want to make sure I understand what its doing before I switch over as it seems like a permanent change to them.

    2. Does Bakery remove old lightmaps (from previous Bakery bakes) for the same scene? What I mean is if I bake a scene and it has 20 lightmaps, I then make adjustments to Bakery that brings it down to 10 lightmaps, will the previous 10 lightmaps remain in the folder, or is it cleared out like the default Unity lightmapping behavior?

    3. How can I get a accurate number of MB my lightmaps are using for a particular scene? I don't see it in Bakery, and it seems that old lightmaps are lingering in the folder, so its hard to get and accurate count.
     
  21. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    Strange stuff happening here.

    What in Unity can interfere with the loading of the lightmaps by Bakery when loading the scenes?
    Out of a sudden it did not load my lightmaps anymore in my android builds.

    I had to do a hack to manually do an additional Refresh on the hidden storage node after the scene was loaded..
     
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    I don't have enough experience using realtime + baked GI combination, but generally the idea was that you toggle the "Combine with Enlighten" checkbox, hit Render and get both generated. usesRealtimeGI is then set to true. If you didn't bake with that checkbox, it'll be set to false, assuming you only want static GI.

    8k proved to be a bit too much in terms of VRAM usage during the bake. You can change the UI script to allow 8192 and try it at your own risk, but it may crash (in which case you can also try disabling TDR).
    Some things force Bakery to split the scene into multiple lightmaps, even if it could fit in one, notably LODs. This is going to be improved.

    Weird! Can you try switching Light Probe mode to L1 (also then you don't have to click Render Light Probes, as they will be rendered anyway during normal Render)?
    BTW, can you take a screenshot of the console panel when this message appears?

    Bakery doesn't do anything special for HDRP SSS materials. It should bake regular lightmaps as for a non-SSS object.
    - Does lighting look 100% right if you bake it with a non-SSS material? (to exclude geometry-related problems or other non-SSS related shader properties)
    - Does it look wrong if you bake with a SSS material and then stays this way no matter how you change the material?
    - ... Does it look right if you bake with a non-SSS material and then change it to SSS?

    Not 100% related link, but hopefully explains it: https://geom.io/bakery/wiki/index.p..._in_one_scene_breaks_its_UVs_in_another_scene

    Currently nothing is deleted automatically. Just in case.

    Good question. There is no built-in way to do that, but it can be scripted (except I'm not sure if Unity has any reliable API to get compressed VRAM size of a texture asset).
    You can get the list of actually used lightmap assets in an active scene like this:

    var s = ftRenderLightmap.FindRenderSettingsStorage();
    s.maps // List<Texture2D> of lightmaps
    s.masks // List<Texture2D> of shadow masks
    s.dirMaps// List<Texture2D> of dominant direction maps
    s.rnmMaps0, s.rnmMaps1, s.rnmMaps2 // List<Texture2D> of RNM/SH maps


    No script execution errors?
     
    Mark_01 likes this.
  23. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    I'll try baking with L1 later on, but having to bake both Lightmaps and Probes at the same time is super slow here on my PC, so I'll probably get back to you tomorrow with this one. Meanwhile I'm trying a new bake on Legacy.

    So there's 2 reasons I actually click Render Light Probe
    1) I didn't know they got baked alongside the lightmap, that's good to know
    2) Because we're using AutoProbe I've laid out all the AutoProbe areas for it to place the probes. Then after the lightmap is baked I generated the probes and after the probes are baked by Bakery, I can use AutoProbe's "optimize probes" function where it deletes redundant or not used probes. So I prefer going step by step on the process (at least at first) to make sure everything is working. Well... that's how it was supposed to go, if unity didn't crash every time I try to bake Probes :/

    Also, here's some photos from my latest crash:


    Edit

    Here's the last Legacy bake that I told you I was doing alongside the console:

     
    Last edited: Aug 26, 2019
  24. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Would be nice to read the end of the console log. Maybe send me your Editor.log (should be normally in C:/Users/You/AppData/Local/Unity/Editor) as it should contain editor console contents after the crash.
     
  25. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Oh, I had edited the last post with this update but here it is again :)



    This is the latest Legacy bake with the end of the Console, also Editor Log here:
    https://www.dropbox.com/s/7vgd5ffzznui9wq/Editor.log?dl=0
     
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Can't see anything unusual. I do change working dir for different reasons indeed, but it happens in synchronous code, and it gets changed back immediately.
    There is a line in the beginning of ftRenderLightmap.cs and ftBuildLights.cs:

    #define LAUNCH_VIA_DLL


    Can you check if it works without that line?
     
  27. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    Nope. Nothing that I found. Checked with adb.

    My temporary fix is to delay the refresh by one frame.
     
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Maybe asynchronous scene loading?
     
  29. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Ok so I did the 2 tests overnight.

    Baking a Scene with L1 enabled worked

    Removing the #define line of code also worked for me to bake Legacy Light Probes on the Bake Light Probes standalone button.

    As I said before I used to get that crash error sometimes, but out of nowhere this error kept repeating every single time I tried baking probes. There are only 2 things I can 100% say changed from before:

    First is that we're using AutoProbe to lay out our probes in the scene and optimize them.

    Second is that we have a new way of sharing lightmaps. We have an Assets/Lightmaps folder that has a Symbolic Link (mklink) to a dropbox folder of the same name. We render all lightmaps of every scene chapter inside this folder and then dropbox does its job of propagating all our lightmaps to our artists. This way the only thing we have to commit on Mercurial is the .unity file of the scene. We've done this so we don't have to commit 1gb Lightmap files or something like this. It's working 100% fine for us without any issues. But maybe this could be something that's causing this issue?

    Also, the ONLY things that are on this folder are lightmaps/lightprobes and any other map bakery renders when you click Render. There are no bakery files nor anything else in those folders.

    PS: Please add an option for bakery to clear the temp folders and delete any old lightmaps before baking the scene :)
     
    guycalledfrank likes this.
  30. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    Yes I am using LoadsceneAsync and additive.
     
  31. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    332
  32. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    8
    Hi all,

    I've been having issues with low quality shadows in some places. Is this a bakery issue or some Unity problem? My light samples are set to 30 currently and all my objects have the generate lightmap boxes ticked. I've gone and separated the walls into smaller objects as well. Any help would be greatly appreciated :)
     

    Attached Files:

  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Interesting. So without the define Bakery uses regular C# API to run its executables. It works well unless there is an apostrophe in the path, in which case somehow it breaks. I couldn't find a proper workaround and just moved executable launching to C++ code, but there I also have to switch working directory for a moment (which looked fine, given the code is synchronous; but I guess Unity might be checking its working dir from another thread sometimes?). Long story short, if you don't have apostrophes in your project path, it should be fine to run without the define :D

    I should. It's just my heartbeat gets fast when I'm writing any kind of file deletion code. Getting complaints about undeleted files is better than getting ones about files deleted by mistake :D

    Possibly related, like the lightmap assigning script being called before the scene is fully loaded.

    It's nice they're allowing this. Bakery does a similar thing if you set "scale in lightmap" to 0 on an object, i.e. it'll be lit by probes but contribute to lightmap shadows/GI on other objects. Internally such objects receive a temporary vertex lightmap, so precision should be a bit (or a lot, depending on mesh size/complexity) better than Unity's probe-only solution.

    It's just your shadow is super sharp and gets limited by lightmap resolution. You can:
    - Increase lightmap resolution (jaggies will get smaller)
    - Enable bicubic filtering for shaders
    - Increase "shadow spread" on the light (best option) therefore making shadow edges slightly blurrier
     
  34. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    47
    Hm then is there a way to find the correct storage component when having multiple scenes loaded additively? If I use FindComponentOfType I can accidently pick one of the wrong scene.
     
  35. elamhut

    elamhut

    Joined:
    Sep 13, 2013
    Posts:
    45
    Goddammit.. I should've thought it would be a naming issue :/ I don't think we have an apostrophe directly in the path. (Remember, baking Light Probes used to work fine) In my case my Project Folder do have a space in the naming (I'm no programmer and my programmers told me, after the fact, that this is not a good thing to do and it could cause issues with some future software :/ ). And because my folder is called DeMagnete Hg (https://i.imgur.com/yqCVzjN.png) and not DeMagneteHg or DeMagnete_Hg I had to add some " when creating the hklink on windows. Maybe the hklink having " due to spacing created this issue?


    hahhahah I promiss I'll report anything that breaks :D
     
  36. PixFactory-Quentin

    PixFactory-Quentin

    Joined:
    Jun 13, 2019
    Posts:
    5
    Hi everybody...

    I have a big problem and I don't know why... I try to bake a scene, not so big, just with 2 building with just walls and windows outside and walls inside. When I launch the bake with "Memory Check" checked, it told me that it can use more than 5600MB (why... my scene is not so huge... Is it a problem with sketchup file ?), no problem, I have a RTX 2080 with 8GB of VRAM...

    But, after some random percentage of advancement, it will stop with the error "Out of memory" :(
    And if I try to force on the GI VRAM Optimization it doesn't work because during the initialisation Unity and C++ just crashed... :mad:

    Someone can help me please ? :oops:

    Thanks a lot !
     

    Attached Files:

  37. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    332
    Does it bake through with 40Texels and 32samples?

    simplest and fastest algorithm.)
    heuristic bake
    if yes raise 50% or be happy
    if not lower by 50%

    On some bigger megascans photogrammetry scenes with lods 80texels was often to much and i had have the same problem.
     
    Last edited: Aug 29, 2019
    Prodigga and guycalledfrank like this.
  38. maart

    maart

    Joined:
    Aug 3, 2010
    Posts:
    76
    Hi Frank,
    I love your product! Sorry but I don't want to scroll through 60+ pages, maybe this has been answered. Maybe we should split up this thread?
    Is there a way to do blending between lightmap-sets? are there shadermap samples for bakery's advanced shaders for hdrp and (universal) lwrp and standard pipeline?
     
  39. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    8
    Made some relevant changes and ended up with this. It's looking a lot better now, thank you so much for the advice :)
     

    Attached Files:

    guycalledfrank likes this.
  40. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    18
    Hi Frank,
    Does Bakery support asset bundle now?
    Lightmap shadows are gone if we use asset bundle. (Lighting is correct, but shadows are gone)
    Is there any solutions to this?

    BTW, everything works on Editor + Asset Bundle.
    However it doesn't work with Build + Asset Bundle.

    Thanks
     
    Last edited: Aug 30, 2019
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    You can avoid that by using this static method:
    ftLightmaps.RefreshScene(scene, null)


    It was only an issue before introducing LAUNCH_VIA_DLL, and spaces were always fine.

    It is possible that either your buildings are huge or your sketchup file is using different units (Unity generally expects 1 unit = 1 meter), and so 80 texels per unit becomes super dense. Just reduce texels per unit or scale down the model (if that's the case).

    I would expect that. BTW, try Checker Preview to make sure the resolution you are baking with is adequate.

    I try to include all frequently asked questions and common solutions in Bakery Wiki.

    No built-in blending, but take a look at this script: https://geom.io/bakery/wiki/index.p...ions#Lightmap_Swapper_.26_Light_Probe_Storage
    Blending can be added with a custom shader. I can give some shader advice on achieving that, but it's hard to make a one-fits-all shader, because of the many rendering pipelines (+ their versions and different shaders within the pipeline). It also seems to be problematic to achieve with either Surface shaders or Shadergraph, as those do not expose any kind of baked lighting input; but it's quite easy to do with "unlit" shaders (and it'll work on all pipelines... except, well, you'll lose dynamic pipeline-specific lights).
    Not sure what is shadermap, but if you load Bakery's example scenes to a HDRP/LWRP project and reassign any Bakery shader materials (these should look pink) to a corresponding HDRP/LWRP shader, they should look as expected (in the case of SH lightmaps in HDRP and SH/RNM in LWRP).

    Now that's nice!

    Do you mean indirect lighting looks correct, but shadow masks are gone? I don't have much experience with bundles, but it feels like some shader variants were omitted from the bundle (and build?). Maybe try forcing these options:

    upload_2019-8-30_11-25-24.png
     
  42. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    100
    upload_2019-8-30_11-42-36.png

    You shold invert green channel on your normal map, it looks wrong.
     
  43. ViperTechnologies

    ViperTechnologies

    Joined:
    Apr 28, 2017
    Posts:
    35
    We have a huge scene [University Campus], we are preparing each building block separately.
    my question :
    - is there a way to bake all the blocks separately and use all of them in one scene + preserving lightmap data and can be instantiated with lightmaps!

    Imagine that we have 10 huge prefabs and in those prefabs we have dozens of objects (members) ... how can we bake these prefabs separately [reason => we are poor and can not afford monster pc :D]
    thank you.

    - We are using LWRP, we are having great problems baking lightmap to terrains and trees!
    can you please guide us if you have any solutions for this as well?

    LWRP best lightmap result :
    ssssss.PNG
     
    Last edited: Aug 30, 2019
  44. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    48
    First thanks so much I have been using this since its release.
    Secondly, the server client distributed render mode is as much as a time saver for me as bakery itself.
    Truly awesome time saver as I can iterate my lighting solutions while I work. (I do wish I could use all 8 of my computers not just one at a time ;) maybe in the future and I would pay more to have that added! )
    Both have saved me so many hours of my life. Truly a life saver.

    The problem I am having is when I am sending a scene over at Texel units set at 12 all works great.
    Once I send over the scene set to 13 or greater it says this.

    error.jpg
    Error:
    ---------------------------------------------------------------------------------------------------------
    SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) (at <c9226b2f33b7421e85bb391f94075e49>:0)
    ftClient.SendRenderSequence (System.Byte[] renderSequence) (at Assets/Editor/x64/Bakery/scripts/ftClient.cs:462)
    ftRenderLightmap+<RenderLightmapFunc>d__218.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4851)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3228)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)
    ---------------------------------------------------------------------------------------------------------

    I traced it in the code and it looks like a socket error / timeout.
    (trace above)
    I did not look beyond that as I wanted to ask here first.
    I really need higher resolution maps and I need to be able to work while it bakes.

    Also how do I now what version I have?
    I think I have 1.6 but I cannot see where to verify that.

    Thanks!

    P.S. I looked all over this huge thread and searched and did not see anything about this.
     
    Last edited: Aug 31, 2019
    guycalledfrank likes this.
  45. Brackaterts1

    Brackaterts1

    Joined:
    Jan 13, 2018
    Posts:
    4
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,087
    Yup. You can bake each in a separate scene using the Lightmapped Prefab component and then drag the prefabs into the combined scene (or just load multiple scenes). There are examples of this included in v1.6.

    What are the problems exactly? Built-in terrain trees cannot be lightmapped (engine doesn't support that), but they can be lit by probes and cast shadows/GI into lightmaps on other objects (including terrain).
    It's hard for me to understand what's going on on the screenshot, but perhaps try toggling Terrain Optimization checkbox and see if it makes a difference.

    Weird! I wonder if there is too much data for the server to write and it fails some timeout in the process.
    Tried to use a longer timeout, please try: https://drive.google.com/open?id=1Pd1ylHbEWf_JhJg6VP4tyeijsIYATzkY

    Not at the moment, but the one particular example on your screenshot can be easily replicated with a simple cookie texture (Bakery Point Light + Cookie projection mode + corresponding texture and angle).
     
  47. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    48

    Thanks for the response.
    That error is gone and here is a new one.
    Now I get a window stating "Bakery error: Can't Connect to server".
    The console does not show an error.

    Thanks again!
    Error:
    e1.jpg

    Last terminal message on the server. cs.jpg

    I have not dug into the code... is there a server time out also?
     
    Last edited: Sep 2, 2019
  48. cbboyer

    cbboyer

    Joined:
    Jun 2, 2014
    Posts:
    2
    Ok, it's 4AM and I've been battling with an AWS instance for a hot minute with no luck. Shout out to keeponshading for the tip on using an instanced machine, here was my experience:

    I spun up an instance with 4 Nvidia Tesla M60s, downloaded and installed Unity, imported Bakery, and tried to bake the default scenes, but I continually encountered "ftrace error -1073741701"

    I was also unable to run ftServer.exe - just got "application failed to launch correctly (0xc00007b)"

    Any thoughts? Has anyone here managed to bake on a beefy instanced GPU? I'm working on a massive archviz scene and this feels like the light at the end of the tunnel - would change the workflow completely. Just set everything perfectly, interior and exterior, lightmaps hi-res as hell, and let Bezos do the heavy lifting. Any tips are extremely appreciated.
     
  49. ViperTechnologies

    ViperTechnologies

    Joined:
    Apr 28, 2017
    Posts:
    35
    couldn't put it to work :( is there any video tutorials for that ?

    i think i somehow solved it by rejig stuff but i will for sure send you more details and will give you headache if i can't overcome the situation again :D thank you.
     
  50. unity_EQf-tZ-Yple_Cg

    unity_EQf-tZ-Yple_Cg

    Joined:
    Nov 14, 2018
    Posts:
    7
    Hello )
    What is this mistake?

    I don’t understand what the problem is (

    MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Object.get_name () (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:189)
    ftBuildGraphics+<ExportScene>d__141.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:4517)
    ftRenderLightmap+<RenderLightmapFunc>d__218.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3761)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:3227)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)