Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

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

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

  1. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
  2. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    37
    Thanks, I'm assuming your are meaning this option from Advanced setting.
    Asset UV Processing
    Configures UV padding adjustment for assets. Possible values:
    - Don't change: don't touch the assets.
    I did this still issue not resolved. Still progress bar getting stuck at
    Adjusting sample points for Level1_LMA6 at 1%

    I read this in the manual.
    There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF occlusion probes option is enabled. L1 mode is now default and recommended when using occlusion probes. Legacy mode will be soon deprecated and replaced with a new L2 mode based on L1.

    The L1 mode is selected for me, but since my project uses Legacy RP, should I switch to Legacy from L1.
    Update: I tried changing to Legacy option from L1 mode and tried baking it still I get the error, also I changed unchecked the option of Unity creating a new scene for baking and tried but got some weird error too, chk image.

    Also, I'm using Mesh Combine all the assets in the scene, but the meshes are not baked, it is set to combine only at runtime.
     

    Attached Files:

    Last edited: May 6, 2020
  3. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,298
    "Can't map texture" just means that UVGBuffer generation DLL can't do this. It doesn't matter which particular resource is causing the problem, because AFAIK the only reason is being out of RAM (it can't allocate enough system memory for a copy of the texture). Your scene is probably very large and it's already using most of your memory. During scene export, additional memory can be taken by:
    - Very high resolution lightmaps (reducing Max Resolution from 4096 to 2048 may help to an extent).
    - Very high geometry detail.
    - Terrains with "Terrain optimization" being off.
    - Painted terrain trees, especially if there are thousands of them and their LOD0 mesh is detailed (their effect on lightmaps can be disabled).

    Added to the wiki: https://geom.io/bakery/wiki/index.p...a_.E2.80.9CCan.27t_map_texture.E2.80.9D_error

    Do you mean it takes a long time for the image to converge from noisy to readable? How does your scene look? I assume:
    - It's very small?
    - You are using small emissive/light mesh surfaces or small windows passing the sky light?

    Very nice answer. Let's explain it in the wiki as well: https://geom.io/bakery/wiki/index.p....22_happens_too_often_and_takes_too_much_time

    First off, your error messages look like you are using different Unity versions. "ContributeGI" was added in 2019.2 I think. If you imported Bakery to a new Unity version, it would auto-update the scripts to use new API, which is not backwards compatible.

    Second, even though you can't bake on a Mac, you can still view and build scenes on a Mac, but as mentioned, you'll need particular required scripts. I recommend making a new copy of the project with these scripts included, as adding them later after opening the project without them may result in Unity losing script references.
    If you still see some artifacts, just try selecting affected models -> right click -> reimport.

    Just make sure to restart Unity before updating: https://geom.io/bakery/wiki/index.php?title=Manual#Upgrading_Bakery

    Interesting. Are you also using Lightmap Groups now? And are all objects inside your FBX not overlap in UV space with each other? "Can't create texture" could be caused by either lack of RAM of VRAM, which in turn could be caused just by a huge number of generated lightmaps. Also before unwrapping them in Blender... did you use Unity's "Generate Lightmap UVs"?

    Try disabling Terrain Optimization. I feel like it can be related.

    Not related, sample adjustment is not UV adjustment
     
    Jakub-Pilar and tntfoz like this.
  4. tntfoz

    tntfoz

    Joined:
    Sep 29, 2016
    Posts:
    103
    Thanks for the info!.

    I dropped the max resolution from 4096 to 2048 as suggested, however the progress is now stuck at 0% "Adjusting sample points for ...".

    The console is at: Running ftrace fixpos12 ... but these usually run through quite quickly on my RTX 2080. This last ftrace has been running for more than an hour now and the GPU is at 100% (RTX mode enabled) which kind of says it's doing "something".

    Can these ftrace processes take that long (they haven't previously in my experience)? Or is it fair to assume something's gone wrong and to try and reduce quality?
     
  5. Jakub-Pilar

    Jakub-Pilar

    Joined:
    May 18, 2015
    Posts:
    37
    Yes.
    No overlapping.
    No lack of (V)RAM, tested it.
    No.

    Jakub
     
    guycalledfrank likes this.
  6. Da-Luk

    Da-Luk

    Joined:
    Apr 25, 2017
    Posts:
    35
    Hi, i have a very small scene with just a few static objects and a mesh light.
    The attached picture shows the RTpreview Window after 60 seconds of trying to show something.
    There are just a few small dots.

    Maybe im not allowed to use non bakery directional light combined with bakery mesh lights for the preview renderer?

    Thanks !
     

    Attached Files:

  7. gingernugget

    gingernugget

    Joined:
    Dec 1, 2015
    Posts:
    4
    We've just finished a project ready to package on the store. This was lightmapped using Bakery but we've run into a few problems.

    I have removed all of the bakery files, with the expection of:

    Bakery folder with...
    • ftLightmaps.cs
    • ftLightmapsStorage.cs
    • ftLocalStorage.cs
    • ftGlobalStorage.cs
    • ftModelPostProcessor.cs
    BakeryLightmaps folder with all the maps for the scene.

    Now when opening the scene we get a lot of errors in the console...

    upload_2020-5-7_16-22-36.png

    Have I removed too much stuff? There were two other files titled ftLocalStorage and ftGlobalStorage with a Unity icon next to them. I kept the C# files but not these. This is what is now in the Bakery folder...

    upload_2020-5-7_16-23-35.png

    I also kept this one...
    upload_2020-5-7_16-24-5.png

    Note: I have now tried including the .asset files for ftLocalStorage and ftGlobalStorage too but get the same errors.

    Also, some of the scene prefabs had a Bakery light script attached to them as it was easier to setup. These now have a missing reference.

    Finally, is there a good workflow when creating content for the Asset Store. Do we need to remove everything every time we publish and then add it all back if we want to make updates?

    Any advice here would be appreciated.
     
    Last edited: May 7, 2020
  8. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    16
    I've applied the overrides to the prefab but I still get this notification that prefab is not going to be overwritten because it contains unapplied data. This happens no matter how many times I apply the overrides. I'm using Unity 2019.3.12f1.

    upload_2020-5-7_21-19-46.png

    In the documentation there's a mention "Nested prefabs are not supported." Do I need to first unpack the prefab completely and create a new prefab or what is the correct workflow?
     
  9. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    215
    The lightmap swapper doesn't seem to work anymore :(

    I wonder why there's no updated asset for this type of thing. Is lightmap swapping just a rare need?
     
  10. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    16
    I'm testing this with example_prefabs_bake scene and with that scene baking works without problems. So it must be something with my own scene. Could it be something with the assets I'm using? Regarding working with the prefabs I unpacked the prefab completely and applied the overrides but that did not help.
     
    Last edited: May 8, 2020
  11. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    16
    I now created a new scene, added my prefabs (that didn't bake) to the new scene and started baking and now there's no nagging about the overrides..
     
    Last edited: May 8, 2020
  12. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    Bakery put some invisible objects in the scene that can get corrupted in random situations. There is an option to remove Bakery from a scene in the Utilities menu.
    Try clicking this on the problematic scene, save it and rebake.
     
  13. tangwilliam

    tangwilliam

    Joined:
    May 4, 2016
    Posts:
    19
    How is the number of pixels in lightmap for each object calculated? Can you show us the formula ?

    With version 1.65, I use the group selector, the scale in lightmap for some objects are set to 1 or some number above 1, but they still get very few pixels in lightmap which has a large empty block within.
    I guess it means that those scales for objects can not make objects fullfill the lightmap, but I do not know what number I should choose to make they fullfill the lightmap.
    I found that the size of pixels for each object is associated with bounds size and whether the uv2 was expand manually. But founding the proper scale in lightmap for each object is still very difficult for me.

    Please help.
    @guycalledfrank
     
    Last edited: May 11, 2020
  14. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    37
    @guycalledfrank thanks yes disabling terrain optimization worked.
    But I tried to fix UV's then I got a weird result see attached image. Also, I turned on fix seams.
    Also since I'm still new to bakery, how do I go back to the original non-baked lighting on my UNity scene if I want too, is there an option in Bakery menu somewhere that I can revert or cancel last baked light.
     

    Attached Files:

  15. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    There is an option in the bakery menu, utilities, to clear any bakery setup in the scene.
    Click that and then go to the regular Unity lighting menu and click remove lightmaps.
     
    ash4640 likes this.
  16. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    I have not realy tried it myself, but you seem to be missing a script as per the FAQs:
    https://geom.io/bakery/wiki/index.p..._who_doesn.E2.80.99t_have_Bakery_installed.3F
     
    guycalledfrank likes this.
  17. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,168
    Hi Guy,

    I extensively use your feature to bake on a network-pc - which is awesome!
    (Working on a low level laptop on my sofa, sending scenes to working station incl RTX card at office is simply great.)
    Until now I have to manually press the "Get Data"-Button after the baking process is done.
    My little request is to (optionally) have the ability to directly recieve the baked images plus getting a visual + audio-alert on my working pc.

    Thanks, great work!

    PS: Is it eventually possible that, one day, we could send scenes via internet?
     
    Last edited: May 11, 2020
    guycalledfrank likes this.
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,298
    Something went wrong, sample position adjustment is usually pretty cheap, really weird. I can only assume it might be related to some really weird/wrong values in the geometry (NaNs, infinities) UVs/normals/positions... Some objects not having lightmapping (or any) UVs? If you can locate and detach part of the scene causing problems and set it to me as unitypackage, I'll debug it and see what's wrong.

    That looks like lights are mostly occluded/blocked in preview. Are you sure they are not? Note that for Bakery all faces are double-sided, so back faces will block light.

    Non-bakery lights just won't do anything in preview (they are on Unity side). Light mesh must work, but seems either occluded or too dim. But if it is baked correctly... sounds like a bake/preview discrepancy that I need to investigate and fix. Any test projects/packages will help to find the cause.

    "Can't locate Bakery folder": weird, because it literally just looks for ftLightmaps.cs and ftModelPostProcessor.cs.

    var res = Directory.GetFiles(Application.dataPath, "ftLightmaps.cs", SearchOption.AllDirectories);
    if (res.Length == 0)
    {
    Debug.LogError("Can't locate Bakery folder");
    return "";
    }


    var res = Directory.GetFiles(Application.dataPath, "ftModelPostProcessor.cs", SearchOption.AllDirectories);
    if (res.Length == 0)
    {
    Debug.LogError("Can't locate Bakery folder");
    return "";
    }


    I just ran this on 2019.3.4 and it seems to work (res.Length > 0).

    "Creating asset at path failed": I can only assume the folder is locked and can't be written. Maybe somehow the system privileges your C# is running under are not enough to search/write the project folder?

    Files look correct.

    Except maybe you lost one, if you're on 1.7+...

    This is expected; you can remove them or leave.

    Not sure, I don't have such experience... but I have a similar one, which is publishing Bakery itself to the asset store. My project is a mess of various experiments, so ticking every file in the "export package" dialog every time was incredibly tiresome. But I found there is very simple API for package generation, so I made a little script: https://drive.google.com/open?id=1SoJ5IcCQ3ftFWCMurLhUTkhpuVJv1lVW
    Usage:
    - Create a txt file with a list of files to export. In Windows, you can select multiple files, shift-click them and choose "Copy as path". Then just paste it to the txt.
    - Remove all quotes and make all paths start with "Assets\", you don't need them absolute.
    - Using the script, click Custom->Generate Package
    - Name the package
    - Drag'n'drop the txt
    - Click generate
    It will generate the package only containing files listed in the txt. I found forming the txt once (and eventually updating) is muuuch easier than ticking the checkboxes every time.
    You can also make a script that would clone the scene (from "working" scene to "export" scene) and clear it from unwanted components.

    TBH this feature was written in the pre-nested times, so I'm not even sure what is "unpack" and what is the correct workflow. Try both?

    If you still get the warning about scale in lightmap not being applied for some reason, just maybe try disabling the validation: open BakeryLightmappedPrefab.cs, and add "return true;" right inside the IsValid() function.

    I relayed this to the script author.

    Mainly this way:

    int resolution = (int)(Mathf.Sqrt(area) * texelsPerUnit);
    resolution = Mathf.ClosestPowerOfTwo(resolution);
    resolution = Math.Max(resolution, minAutoResolution);
    resolution = Math.Min(resolution, maxAutoResolution);


    This gives you square resolution. If object is not square-like, assume this resolution is for its largest UV axis.
    Atlas packer can then also stretch them a bit to reduce holes.
    xatlas may apply more extreme stretching comparing to my default packer.
    Scale in Lightmap is actually used... as an area multiplier. Which is probably incorrect, but changing it now would break everyone's scenes :confused:

    I definitely recommend using 1.7+ and pack atlases with xatlas.

    How did you fix them? "Fix seams" is unrelated. Object looks like it doesn't have any lightmapping UVs.

    Bakery->Utilities->Clear baked data

    Nice :cool:

    I guess you are not working in Unity during the bake? Suddenly going into the download/import process may be a bit... distractive. But yeah, it's totally not hard to add.

    It will already work, if your server IP is ping-able. I'm just unsure about the speed. Quite a lot of data to move. Ideally it needs better compression for such transfers.
     
    Last edited: May 11, 2020
  19. tangwilliam

    tangwilliam

    Joined:
    May 4, 2016
    Posts:
    19
    thanks for your answer. I will try 1.7
     
  20. lauris47

    lauris47

    Joined:
    Mar 7, 2012
    Posts:
    46
    Hey, does Bakery bakes faster the second time if the cache is not cleared (like Unity's bakers)? If yes, do you recommend doing that if some models were changed or modified?
     
  21. Da-Luk

    Da-Luk

    Joined:
    Apr 25, 2017
    Posts:
    35
    I found out what was going on with the mesh light, it seems that there is a problem with the mesh scale. I used another mesh geometry for the lamp and the preview renderer worked. Maybe i have to use a certain scale factor for mesh lights when creating objects from blender.
     
    guycalledfrank likes this.
  22. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    16
    I mean this "Unpack Prefab Completely"


    upload_2020-5-12_14-25-6.png

    Thank's for the advice. I created a new scene just for the room prefabs and when I need to bake the lighting I open that scene and generate lighting. Seems to work.
     
    guycalledfrank likes this.
  23. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    84
    The organization of the asset folders for this package are terrible, please consider at least organizing the examples.

    If there's any chance of me giving this asset a 5 star review, I expect to see a big improvement with how the folders are organized. When I open the root Bakery folder, I do not want to be assaulted with ~50 files to sift through in order to find what I'm looking for.
     
  24. gingernugget

    gingernugget

    Joined:
    Dec 1, 2015
    Posts:
    4
    OK, I updated Bakery to 1.7 and gave this another try.

    As soon as I try and move ftLightmaps and ftLightmapsStorage out of their original folder and into a folder within our pack I get these errors...
    upload_2020-5-12_18-46-7.png

    The game will now not play as compiler errors need to be fixed.

    Note we are running on Unity 2019.2.12f1 so perhaps need to do an update here to fix this?
     
  25. Phazorknight

    Phazorknight

    Joined:
    Dec 31, 2014
    Posts:
    4
    Hey everyone, I'm having trouble with my lightmaps / getting decent results.
    Currently, my biggest problem is having random game objects simply don't get baked in the lightmap/affected by it. No Idea how and why. I've attached a pic as an example: the fence seems not lit.
    I've also attached my settings.

    Would appreciate any pointers, I'm fairly new in using Unity (about 3 months) and lighting my scene with baked lightmaps.
    Using Unity 2019.3.13f, URP setup. Using Bakery v1.71.
     

    Attached Files:

  26. ariessanchezsulit

    ariessanchezsulit

    Joined:
    Apr 3, 2017
    Posts:
    6
    Hi,

    So I'm using Bakery with these settings.

    Render mode: Full Lighting
    Directional mode: RNM

    The baked output is really good, but for some reason every time I pulled my changes on a different machine, my light probes is always not working properly and I discovered that the generated lighting data asset always gets corrupted with LFS. May I know what serialization you use on exported lighting data asset? as it always get corrupted after downloading from LFS.


    Corrupted light probes asset

    Light-probe-asset.PNG

    Not working light probes
    Light-probe-look.PNG
     
    Last edited: May 13, 2020
  27. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    16
    New problem. I've baked the lightmaps and I noticed that when I move the camera away from the object the lighting disappears. Also it seems that the lighting is not correct on the wall anyway. What could be causing this and how do I fix it?


    light.PNG no-light.PNG
     

    Attached Files:

    Last edited: May 13, 2020
  28. Bentoon

    Bentoon

    Joined:
    Apr 26, 2013
    Posts:
    70
    helloHello,

    I want to use Bakery on my PC to bake lightmaps into prefabs that I could then access on Mac for mobile build.
    Is this possible?
    Thanks!

    ~be
     
  29. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    It can be done but it's cumbersome: you will have to remove all Bakery's scripts except the specified ones in the manual if you want the project to compile on a Mac. Then when you open your project on Windows you will have to put all the missing files in their place to be able to bake with Bakery again.
    I guess you can just move folders in and out each time. (and you could automate the process with a BAT file on windows at least. Idk on Mac)
    I haven't tested this myself and some people have been having trouble with that. So, your mileage may vary.

    EDIT: I don't know if you can make a bakery prefab on a project and export it to another project though. It "should" work but @guycalledfrank will have to confirm it.
     
    Last edited: May 14, 2020
    guycalledfrank and Bentoon like this.
  30. peeka

    peeka

    Joined:
    Dec 3, 2014
    Posts:
    81
    I am on unity 2019.3.12f1 URP 7.3.1
    I have a lightmapped prefab setup and baked, lightprobed with L1, everything works fine in my baking scene.

    however when I spawn the prefab into another scene in editor, the lightprobe will not work, it appear as a constant grey color probes without baked light.

    I can't find anymore information about lightprobes in lightmapped prefab. can lightmapped prefab store lightprobe? if not any recommendation on how to setting up lightprobe to use with lightmapped prefab, thanks..
     
  31. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    Light probe data is stored per scene in Unity.
    What you are storing in those prefabs are the Light Probe Groups needed to render the actual light probes in the scene.
    It's just a way to tell Unity WHERE to sample the actual light probes data, but you need to render it per scene anyway.
    You can then additively load scenes in Unity that will add their own light probes to the current scene light probes, but you can't store those light probes in a prefab. Only in Unity scenes.

    So, just place your prefabs with their light probe groups on the scene and then bake the light probes for the whole scene.
    You will have to render the light probes for each scene you place your prefabs on, but since you already placed your light probe groups on the prefabs, you will not have to manually place them each time. You just press "render light probes" for each scene and that's it.
     
    guycalledfrank and peeka like this.
  32. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    44
    Hello there,

    im running into a problem with sharing my bakes from my pc to my laptop. Im using sourcetree so i can share my project easly from pc to laptop but i run into the problem that the uv cordinates are different.

    I do my bake op my PC, and im getting the result i want. transfer that to my laptop and the uv lightmaps are all in the wrong place. any clue how i can fix that?

    PC


    laptop


    thanks
     
    Last edited: May 14, 2020
  33. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    244
    Any tips for preventing these bright edges that sometimes appear where walls and ceilings meet?
    F3pTT1uxXa.png
     
  34. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    244
    So you can ignore my last post, as it actually had nothing to do with the bake!

    In my case it was the Bias and Normal Bias settings on the real time directional light combined with the Shadow Distance being too low in quality settings.
     
  35. mayorc1978

    mayorc1978

    Joined:
    Dec 30, 2013
    Posts:
    36
    Does this support Out of Cores technology? Cause when I use Unity Lighmapper on my GTX1080 when I go for 4k lightmaps it suddenly switches to CPU baking, passing from a bunch of minutes to 8/10 hours.
    This would be a reason to buy this, cause without I don't see a big difference compared to Unity solution.
     
  36. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    54
    It is a shame that unity gpu lightmapper cannot be used, luckily there are people like frank !!!!!
     
    guycalledfrank and atomicjoe like this.
  37. KospY

    KospY

    Joined:
    May 12, 2014
    Posts:
    95
    I got the same issue as Object-Null, we are using GIT but lightmaps are always broken on other computers.
    We tried disabling asset UV processing, syncing or not syncing ftGlobalStorage and ftLocalStorage, etc...
    We are running out of solutions, baking only work on the computer doing it.
    We don't have this issue with Unity baking, I suppose Bakery record some hidden stuff somewhere but we can't find where :(
     
  38. Object-Null

    Object-Null

    Joined:
    Feb 13, 2014
    Posts:
    44
    fine to know I'm not the only one. but indeed i tried alot of stuff too. it is hard to see witch file is responsible for it. ofcourse it would be nice to have some fix for it. @KospY did you mentioned the problem here before?

    lets hope the owner can tell something more about it.
     
  39. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    244
    I am currently getting some very harsh "ringing" in my light probes when using L1 mode with the Indirect render mode, so I've resorted to using Legacy mode.

    Is there any disadvantage to using Legacy mode?
    Do you have any tips for getting L1 mode to work without the ringing issues?
     
  40. KospY

    KospY

    Joined:
    May 12, 2014
    Posts:
    95
    @Object-Null First time I'm posting this issue. I'm currently spending hours trying to find a fix, moving baked files from one computer to another. No luck so far...
    I'm using Unity 2019.3.11 with URP.
    What is really strange is baking don't transfer anymore with Unity baking too! :eek:
    I'm currently trying copying scenes and even creating new ones and copy/paste stuff, but it doesn't seem to work too.
    I'm not sure if it's bakery messing up some stuff or simply a new bug from the latest version of Unity.
     
  41. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    Both L1 and Legacy light probes generated by Bakery suffer from ringing.
    Only Unity's lightmapper has the ability to remove the ringing.
    It's a feature I would really like to see implemented in Bakery :(

    The only disadvantage is that it takes longer to bake than L1 and you can't focus on any other application than Unity while it renders, otherwise the lightprobes get corrupted.
    Apart from that, the light probe quality is actually better than L1 and is the recommended choice if you want to bake full lighting into light probes (not only indirect lighting).
    For the rendering times though, download the latest version of Bakery from the Github repository: it bakes legacy light probes more than 3 times faster.
     
    Graham-B and guycalledfrank like this.
  42. mayorc1978

    mayorc1978

    Joined:
    Dec 30, 2013
    Posts:
    36
    What do you mean?
    Does this work when you're out of GPU memory (for 4K lightmaps or higher), or not?
     
  43. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    It does work with 4k lightmaps but will obviously not work if you run out of GPU memory. You will have to lower your settings if that happens or divide your scene in zones and bake them separately.
    Bakery offers much more than this however: lightmap prefabs, Xatlas texture packing, no light leaking across walls, AI based noise removal, much faster renders at higher quality...
    You should read the manual to check all the benefits.

    It is however not as well integrated into Unity as Unity's lightmapper, so it can be less convenient to use.
     
  44. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    Personally, I just can't go back to Unity's builtin lightmapper after having used Bakery.
     
  45. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,298
    Not by default, but you can uncheck "Update unmodified lights" to skip any lights that didn't change.
    Not recommended if models/resolution/atlasing were changed or modified.

    Hmm what scale did it have? Very large/small/inverted?

    And what are you looking for? I usually just use the search bar. Can never remember long nested directory paths. Matter of habit?
    All my harddrives are barely organized, but I just use voidtools to search through them :D

    Hmm maybe it is related to assembly definitions? Can you try deleting BakeryEditorAssembly.asmdef and BakeryRuntimeAssembly.asmdef and reimport scripts?

    If they have proper lightmapping UVs, then they are probably too low-res. What is the size of your buildings? Is 1 unit = 1 meter, or are they smaller? If they are just too small, try increasing texels per unit or scale in lightmap.

    Lighting data assets are generated by Unity. We don't have direct access to them (you can join to my rant). They are completely out of my control :(
    Maybe you can copy the file directly without LFS?

    Are you sure they are baked and it's not regular realtime forward lights hitting the per-pixel light limit? Do you use Bakery light components?

    I think it should work. Just set up your Mac project once (with the required scripts), then importing any prefab package should get the scripts hooked.

    https://geom.io/bakery/wiki/index.p...2Fother_version_control_system_with_Bakery.3F

    ... usually it's just about reimporting the models.

    No (as underlying OptiX library does not support it). It just tries to use less VRAM in various ways. And apparently it uses less of it comparing to Progressive. Still, I recommend having > 4 GB VRAM.

    It's only because of the UV padding adjustment. Unity just doesn't perform it. At all. If you disable it (and rebake you scenes with "remove UV adjustments"), there won't be any difference to Unity bakes in terms of version syncing.

    You should definitely get the latest github update where I integrated @atomicjoe 's impovements to the Legacy rendering code. They are waaay faster now!

    Using a small shader modification will cure any ringing. This is built into Bakery shader: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_shaders

    There is a higher chance of discrepancy between lightmap/probes because unlike the lightmapper it uses regular camera rendering to capture GI/sky/area lighting. It is especially problematic for mobile projects, where HDR lightmaps are often clamped to a very narrow range, making probes reflect dimmer light. L1 probes are rendered within the lightmapper, in full precision. They will be improved to contain complete L2 coefficients (soon).

    Legacy is less susceptible to ringing. Actually, it would be nice to have a test scene with some extreme cases. I can add some options to control the ringing.

    Actually "fixing" ringing is often done by simply increasing the weight for lower frequency parts and decreasing it for high freq. If you open ftRenderLightmap.cs, you can find the standard coefficients used (for Legacy):

    upload_2020-5-16_9-8-55.png

    Here is an example of what you can achieve by tweaking them: https://forum.unity.com/threads/bak...tpreview-released.536008/page-69#post-5035211
     
    Graham-B likes this.
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,298
    AntonioModer and atomicjoe like this.
  47. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    To be fair, I prefer that than lots of nested directories with barely (if any) files in them except for more directories.
    Takes ages to navigate!
     
    Last edited: May 16, 2020
    guycalledfrank likes this.
  48. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    It's as simple as making a directional light with an intensity of 10 with an ambient light of zero and you will see how it overshoots badly in the shaded zone of a sphere.
    "but why would you make a light so bright" I hear you say.
    Well, the sun is actually way brighter than that compared to the rest of the scene, and the secret to a realistic lighting is to match real light intensities and use tone mapping to bring those HDR values into LDR territory as a post process.
    If you tone map the image with a low gamma to have a brightness curve that rises quickly on the dark tones but flattens in the high tones, you get a pretty accurate approximation of how the human eye perceives the world and you don't need to adjust exposure anymore, since every part of the image will be in LDR range.
     
    guycalledfrank likes this.
  49. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
     
    guycalledfrank likes this.
  50. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    788
    I have checked your implementation of the geomerics L1 fix in the Bakery shader and have implemented it in my shaders.
    The Geomerics fix is not worth it if you use L2 light probes: it's much slower and gives the same light ringing as a regular L2 light probe.
    I have had the best visual results by making a regular per pixel L1 + L2 SH calculation and multiplying the L2 coefficients by 0.5: now the light probes don't "overshoot" anymore :)
    So, YES, exposing an L2 coeff multiplier in Bakery's GUI would be VERY useful. (this way I will not have to modify the source every time I update Bakery :p )

    (Note that by default, Unity's standard shaders don't do a full per pixel L1 + L2 SH calculation. They calculate L1 per vertex and L2 per pixel. This gives a very bad lighting approximation when using normal maps and I don't understand how they thought this was a good idea to begin with.
    Inspecting Unity's standard shaders, I found it "should" be a way to force a full per pixel SH calculation using some undocumented defines, but enabling them has only led to compilation errors for me, so if anyone has any idea on how to enable full per pixel SH calculations on the Unity standard shader, please tell me. It could be usefull.)
     
    Last edited: May 16, 2020
    guycalledfrank likes this.
unityunity