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

    CodeStarrk

    Joined:
    Jan 5, 2017
    Posts:
    37
    upload_2019-5-1_0-41-18.png


    So I tried to do RNM and I enabled physical light falloff Deferred and bicubic interpolation, now I try to render and I get this error... huh? I also changed the shader and ticked on the RNM part

    I had some problems by the way with permissions on windows for the bicubic enabling, fixed it by running as administrator and disabling antivirus. But how can I fix this error in the image? This is weird
     
    guycalledfrank likes this.
  2. CodeStarrk

    CodeStarrk

    Joined:
    Jan 5, 2017
    Posts:
    37
    Nevermind, works now for some reason.


    Edit: Also thanks for the shadow spread advice, this fixed it!
     
    guycalledfrank likes this.
  3. Aki-DAI

    Aki-DAI

    Joined:
    Jul 30, 2015
    Posts:
    5

    Thanks a lot Dawie for this quick reply! So it's speed tree that is THE troublemaker. I am using that free package it provided in assets store in this trial project now but I actually own its desktop bundles. I will try those trees but I doubt the same bug exists as well, because to make speed tree I remember there is some template/pipeline designed, then if a problem exists on one sample, then probably it has expanded everywhere >_<

    Perhaps I can try to build some customized speed trees by myself to figure out whether we could this UV issue could be avoided later, but it's not a bad idea to apply some non speed-trees plantation assets just as what you have done to deliver "something" as soon as possible. Deadline is usually the productivity.

    Yes Amplify Impostors is a nice idea for a wide environment, I got it in the winter sale last year but haven't started to use it since it's always on Beta...Perhaps I can try it in this project, too. Currently my solution is SECTR, but still thinking of using GPU instancer. Let me try them all then compare their performane data.

    Thanks again and let me poke you later if I find something new on this topic. :)
     
  4. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    If the price increased 3 days after you bought it, would you pay the difference?
     
  5. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    As Dawie said, SpeedTrees may lack proper lightmapping UVs.

    Weird. Does it work if you disable RTX mode?

    Decreased? AFAIK price didn't change since the end of some Christmas sales (or at least I wasn't aware). I'm not sure it's fair to pay the difference in this case, or I should do it for everyone :)

    Oh well it looks like there is a May sale going on now!
     
    Last edited: May 1, 2019
  6. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hi, sorry for the confusion, my post was in reply to another user who deleted their post! That user said that they felt ripped off because they bought the asset 3 days ago and now there is a sale and they expect a refund... I was just trying to point out how silly that was, hehe.
     
    guycalledfrank likes this.
  7. Hipfire_Kim

    Hipfire_Kim

    Joined:
    Oct 17, 2017
    Posts:
    4

    tickGIInEditor.UpdateSceneStatic() takes 99.9% of resources
    This is not Bakery code though. I'm not sure what to expect but can you try following?
    - Open ftLightmaps.cs
    - Find Lightmapping.bakedGI = true;
    - Set it to false. Save. Try dragging prefabs again.
    I feel like there is some weird unrelated logic being executed by Unity when bakedGI is set to true, and it still kinda works even if it's false.

    Thanks, seems to work great!
     
    guycalledfrank likes this.
  8. CodeStarrk

    CodeStarrk

    Joined:
    Jan 5, 2017
    Posts:
    37
    Do I need to re render the entire thing after I only change the color of the Direct Light?
     
  9. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    I bought this as we've had constant issues with Unity's light map baker crashing, giving bad results, etc.. Bakery seems more stable but I'm not getting accurate results. Any idea what's going on here? The first is from Unity's progressive lightmapper with default settings (changed texels to 2/unit and set directional mode). The second is from Bakery with similar settings. I didn't do the gamma fix as it sounded like that was a project wide setting and I can't have it potentially cause issues on other scenes as this is a released game and I've struggled to get lighting to a usable point.
    LM1a.png LM1b.png
     
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Yep.
    You can skip some stuff though, if you go to experimental settings and uncheck "export geometry" and "update unmodified lights".

    Progressive/Bakery settings are rather different and not directly comparable. Probably try Checker Preview to see if the texel size you're baking with is adequate (maybe even post a screenshot with checker visualization).
     
  11. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79
    Getting bright spots when using mesh lighting: upload_2019-5-3_0-46-37.png

    Using this as a template:
    upload_2019-5-3_0-47-12.png

    upload_2019-5-3_0-47-47.png

    upload_2019-5-3_0-48-4.png
     
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Weird, and I can't see the light mesh itself. Is it under the floor? Can you check if it goes away if you disable Selfshadow checkbox?
     
    unity_dev3194 likes this.
  13. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    This sounds really interesting. We're looking for a solution to bake several different sun angles for the same scene, and blend between them, to show different times of day.

    Would that be a scenario you aim to support with blendable lightmaps? Any estimates on when you think you'll finish the feature?
     
    guycalledfrank likes this.
  14. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Most awaited killer feature here too.

    I tried some stuff and a good solution could be to have ShaderGraphFunctions for Amplify Shader and ShaderGraph to avoid Shader update madness for new Unity Releases and solve some BuiltIn RP, LWRP and HDRP dev redundancies and simply blend in ShaderGraph. ShaderGraph allows additional access to BakedGI now
    https://docs.unity3d.com/Packages/com.unity.shadergraph@5.3/manual/Baked-GI-Node.html
    and nearest Reflection Probe
    https://docs.unity3d.com/Packages/com.unity.shadergraph@5.3/manual/Reflection-Probe-Node.html

    So everything needed to blend/switch full lighting could then be nicely done here.

    Amplify has something like this already

    Lightmap (1).png
    and also a Decode Lightmap Node.

    Also this one works great like i wished it would be default behaviour in Unity.
    https://github.com/laurenth-unity/lightmap-switching-tool
    and even better
    https://github.com/guiglass/Lighting-Scenario-Switcher
    because it solves to switch everything whats needed for different lighting scenarios. The custom UID solution used here could be probably solved with Unitys Adressables now.
     
    Last edited: May 3, 2019
    guycalledfrank likes this.
  15. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    I originally had the texels set to 20/unit but this caused an out of memory error even though it's just using 67% of available memory. I then set them back to 2 which is what I typically bake with progressive/enlighten and it ran with the results below. The checkerboard shows some issues on the roads and other areas but if you look at the walls of the house, the checkerboard is fine but they have lots of issues so it seems like there's something else going on.
    LMError.png LMResults.png LMChecker.png .
     
  16. Softelectro

    Softelectro

    Joined:
    Oct 9, 2013
    Posts:
    24
    Yes, we always make custom lightmap UVs.
    There is a padding around any UV lightmap but there is no padding inside a closed shape.
    This is what we see in the below picture. It generate black pixel with strange effect.
    Lightmap Dejoint.png
     
    guycalledfrank likes this.
  17. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79

    The light mesh has its mesh renderer disabled. Self shadow was disabled, check the screenshot I posted of the light mesh material.

    How can I get results similar to this: upload_2019-5-3_13-18-18.png

    I can't make use of 'Samples Near' if I don't enable Self Shadowing.
     
    Last edited: May 6, 2019
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    At this point I'm not sure what would be the best way to implement it. The key problem is that blending must happen inside a modified shader. Bakery does have options to extend standard shaders and even a built-in customized shader to support some extra features, but a lot of people are using assets like Amplify, and SRPs are becoming bigger with their shadergraph approach. It's hard to come up with a shader modification that'll work in all cases. It's an even harder problem to maintain compatibility with all these approaches, as they get updated frequently.

    Another interesting problem is how do you tell Bakery what difference should be between different lightmaps in a blendable set. Sun angle and skybox settings is one obvious use case. Another case is when you have a door open/closed. Lamps on/off. Train outside/inside a tunnel.
    Performing these changes by hand, clicking Render, repeating is error-prone. Sometimes you'll forget to toggle that one object and waste your time. Automating it is a better idea, but it seems like there might be A LOT of options to store for each state: selected objects' transforms and on/off toggles, selected lights' properties. Should it be maybe a scripted callback? E.g. if Bakery would call OnChangeEnvironment(int) from your script and you would switch lights, open doors, etc? Should Bakery come with a few "typical use case" scripts that would implement this function?

    If Amplify and SRPs today have a lightmap color input, that does indeed solve the problem... thanks for pointing out, I'll check it :)

    OK, that's odd. Are UVs generated within Unity or come from your modeling package? Can you check if baking the building model alone in a separated scene works well?

    Can you send me this model (or this part of the model) for debugging?

    If selfshadow option is disabled on the Light Mesh, then "Samples Near" won't appear.
    How big is the mesh and where is it located?
     
    DEEnvironment likes this.
  19. Da-Luk

    Da-Luk

    Joined:
    Apr 25, 2017
    Posts:
    53
    Hello, i bought bakery gpu yesterday and everytime i try to render a scene unity crashes after 3 mins and i got the following error popup "can't create texture"
    If i check the error.log file i got this:

    Unity Editor [version: Unity 2017.2.0f3_46dda1414e51]

    frender.dll caused an Access Violation (0xc0000005)
    in module frender.dll at 0033:bb005a89.

    Error occurred at 2019-05-04_220448.
    C:\Unity\Programme\Unity2017_2_0\Editor\Unity.exe, run by Luk.
    60% memory in use.
    32447 MB physical memory [12903 MB free].
    128447 MB paging file [69845 MB free].
    134217728 MB user address space [134205682 MB free].
    Read from location 00000000 caused an access violation.

    I hope you could help
     
  20. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    what shader are you using on your terrain ?

    I suspect this is not Bakery related and your crashing a driver and every thing after (frender.dll ) is because that failed driver.. you have two options possible for debugging.. 1 reduce the complexity of the shader that is causing the TDR strike on your GPU example turn off all Triplane functions in the shader … 2. disable TDR in your windows registry set WDDM TDR to "False"

    https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys
    http://developer.download.nvidia.co...e/HTML/Content/Timeout_Detection_Recovery.htm
     
  21. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    I am trying to get some Terrains to be baked, but they just show up all black, even with the Terrain optimization. Any ideas?
     
  22. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    some more details to get faster into.. because documentation is preview too.)

    An Bakery Shader Graphs Custom Function Node could be the right way for SRP s.
    Here an example from Rizu
    https://forum.unity.com/threads/occlusion-probes.531573/page-2#post-4244413

    He did an Unity Package for OcclusionProbes.
    Wrote an Custom Function Node to made them available in Shadergraph and then then he multiplies it in an Subgraph to the BackedGI Node to extend the Lit Master.

    occlusion-probes-custom-function.jpg

    occlusion-probes-subgraph.jpg
    Could be stabil for upcoming HDRP SRP versions.

    But i did not found an LightMapST sampler like in Amplify available under the ShaderGraph Nodes to get the lightmap color input.

    Here latest implementations for HDRP
    Occlusion Probes

    And an old one....
    He a did the same before in Amplify for BuilIn with three custom ASE (Amplify Shader Editor) shaders (and two shader functions).
    First Repo in
    Occlusion Probes[/URL
     
    Last edited: May 5, 2019
    guycalledfrank likes this.
  23. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Seems like you're going out of video memory during scene export (before the bake). This advice from FAQ should help:

    The most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by Texels per Unit or set explicitly in Lightmap Groups. Reducing it will help. You can always selectively use high resolution for important objects via Scale in Lightmap.


    Texels Per Unit example values:
    Large outdoor area: 1 - 5
    Medium outdoor area: 10-20
    High quality interior: 100


    Nah, this one is clearly a memory issue, not a TDR issue.

    And even without? Dumb question, but... does it get better if you change the terrain a bit so it's not completely flat?

    Daaamn this is good :) Thanks!
     
    DEEnvironment likes this.
  24. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    Yup, with the Terrain optimization on/off, same result. Is there a shader I use with the terrain? I just kept it with standard. In the pic I posted, I made a small piece of terrain that's completely flat.
     
  25. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Standard shader is fine. The question is, does it work with a non-flat terrain? Is the problem only specific to flat terrains or all terrains?
    Can you show the list of baked lightmaps, is there really a fully black assigned texture? Or does terrain just have no lightmap assigned?
     
  26. Softelectro

    Softelectro

    Joined:
    Oct 9, 2013
    Posts:
    24
    Hello,

    In the attachment, there is the 3D file which have the issue.
    If you need more info, don't hesitate.
     

    Attached Files:

    guycalledfrank likes this.
  27. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79
    Mesh is a plane and its dimensions are 0.43, 1, 0.617
    It's the white plane on the bottom, above the floor and isn't clipping through any geometry: upload_2019-5-6_12-4-16.png
     
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Thanks!
    So yes, indeed this model manages to confuse Bakery's leak fixing algorithm. Bakery does push rays outside of closed surfaces if it sees a sample is behind a polygon, i.e. looking at backfaces.
    This mesh is however tricky, as it's thin and two-sided. If I delete the inner part, leak fixing works correctly:

    upload_2019-5-7_17-44-19.png

    upload_2019-5-7_17-44-30.png

    Fixing cases like this is tricky, as it would need a completely different algorithm. I added it to my TODO list though.

    Seems like it's quite large? I would recommend using a simple emissive material without a light mesh then. They're fast and stable for large surfaces.
     
    unity_dev3194 likes this.
  29. JorgeRC6

    JorgeRC6

    Joined:
    Apr 17, 2018
    Posts:
    1
    Hi guys could I get some help about something? I was trying to look for it but I couldn’t find anything.

    What would it be the workflow to make lightmaps work with asset bundles?

    We have an app that basically is a 3d buildings visualizer for iOS, where we don’t have any model in the app at all, everything is loaded from asset bundles from the server. I created the lightmaps with bakery and I baked them to the prefab with the model, everything working fine when I tested Instantiating them at run time playing on the editor and all that. Then I created the asset bundle and uploaded it to the server, but the ftLightmapsStorage script in the prefab (or any at all actually) cannot be added to the asset bundle, so whenever I load the bundle of course the model doesn’t have any lightmaps.

    How can I make this work?
     
  30. memelotsqui

    memelotsqui

    Joined:
    Apr 16, 2013
    Posts:
    5
    Why is not available?
     
  31. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Looks like the entire asset store is broken.
     
  32. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    I think my problem is that I don't have lightmaps assigned. I was thinking marking my terrain as static would generate the lightmaps. Am I mistaken? I haven't worked with terrain much before.
     
  33. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Hmmm, I didn't test it myself, but I know zornor90 used bundles successfully, so maybe ask them.
    I think you must have Bakery scripts in the main scene, before you load the bundle, as bundles can't have scripts on their own (on iOS at least).

    Hmm? Seems to be working fine now.

    Yes, if terrain is marked Lightmapped Static, that should be enough. Also "Scale In Lightmap" option on the terrain should be larger than 0. Also it shouldn't have the EditorOnly tag. Other than that, there isn't anything special. If you can send me this scene (just the terrain) as unitypackage, I can take take a look and investigate.
     
  34. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79
    Thanks, emissive lights don't have the same bright spot artifact. They do present another problem. Emissive materials don't bake if 'Cast Shadows' is disabled. This emissive plane is right above the floor and turns the entire floor black while lighting up the walls and ceiling. What would you suggest in this situation?
     
  35. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    Start a conversation on a different window. Not sure if that's that way to send a message.
     
  36. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    I cleared a bunch of assets (mostly .cs scripts) and ran the test again. Seemed to have worked. Going to keep testing. I'll let you know
     
  37. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    35
    Hi there.

    Is there a way to use Bakery with LWRP (baked lit material --only one that works), but also use realtime lights on it? Bakery baked meshes are not getting affected by realtime lights.. no lights affect and no shadows on them.. from real time lights.

    also using baked material kills all the specular.

    is this is current limit to LWRP?
     
  38. c_agwill

    c_agwill

    Joined:
    May 31, 2017
    Posts:
    4
    Apologies.
     
  39. c_agwill

    c_agwill

    Joined:
    May 31, 2017
    Posts:
    4
    Hey Frank. My team is using the Bakery for an android project and we're having some problems with lightmap shifting after uploading to perforce. The lightmaps look fine on the workstation they were baked on, but seem to offset and rotate on other workstations after downloading. Is there a specific file not being uploaded to p4 that is affecting this?
     
  40. Softelectro

    Softelectro

    Joined:
    Oct 9, 2013
    Posts:
    24
    Thanks for your time, I will check this double side meshes, and make some more tests.
     
    guycalledfrank likes this.
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    True. What effect are you trying to implement? Large invisible area lights sound a bit like a hack. The room doesn't look like it needs an invisible floor light. For window lighting generally using the Skylight gives pretty good results.
    If Light Mesh does not cast shadows, "samples near" option won't work, so you need to increase "samples far" parameter instead (quite a bit).

    Weird. Which version of LWRP/Unity? And same thing doesn't happen with standard lightmappers?

    From FAQ:
    You should only commit your project files and ignore Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery). If, for some reason, you decide to commit Bakery folders, then make sure you ignore Assets/Bakery/ftLocalStorage.asset and Assets/Bakery/ftGlobalStorage.asset to avoid getting lightmaps out of sync.
     
  42. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79
    This is what the interior looks like with just the skylight and a directional light:
    upload_2019-5-9_12-39-42.png

    This is the interior with a Bakery light mesh:
    upload_2019-5-9_12-42-18.png

    This is the interior with an area light, using Unity's Progressive GPU mapper (what I'm trying to replicate):
    upload_2019-5-9_12-40-21.png

    Skylight and a directional light have not been enough in my case to light up interiors. Increasing the number of bounces changes the way the exterior looks. I'm very happy with Bakery's light mesh except for the bright spot it seems to create (also brightened the ladder). You suggested I use emissive materials, but they turn the floor complete black (or whatever geometry exists in the opposite direction). I just want to be able to replicate an area light.
     

    Attached Files:

    guycalledfrank likes this.
  43. unity_dev3194

    unity_dev3194

    Joined:
    Apr 17, 2017
    Posts:
    79
    Sorry for the double-post, but I'm suddenly facing a new issue with objects having really bright faces on bake:
     
  44. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Interesting. Perhaps it's the combination of window being rather small, relatively low lightmap resolution and relatively low skylight sample count. Increasing any of these factors would probably eliminate the difference. On a more practical note, perhaps you should try adding a Light Mesh inside the window instead of the floor. You'll need way less samples, as the area of the light would be smaller, but the effect should be similar. Floor will still bounce the light upwards.
    Also your sky lighting might be set up differently to progressive (Bakery's being set up darker), that'd explain it.

    I'm pretty sure it got lower resolution than the one in Progressive. I'd just try increasing Scale in Lightmap on the ladder.

    Something's off with UVs? Is the bright thing a separate object, or is the whole building just a single mesh?
     
  45. c_agwill

    c_agwill

    Joined:
    May 31, 2017
    Posts:
    4
    From FAQ:
    You should only commit your project files and ignore Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery). If, for some reason, you decide to commit Bakery folders, then make sure you ignore Assets/Bakery/ftLocalStorage.asset and Assets/Bakery/ftGlobalStorage.asset to avoid getting lightmaps out of sync.
    [/QUOTE]

    Thanks for responding so quickly.
    Unfortunately we've been implementing this and are still getting the same result.
    The only files we are updating and transferring after a bake are the contents of the Bakery lightmaps folder and the scene file with the metas. Is this correct?
     
  46. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Yes. You also need updated meta files of models used in the scene.
     
  47. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    It seems like many people asked about an AO-only baking mode, as it's useful when used in conjunction with some sort of dynamic time of day, so I added it:

    upload_2019-5-12_15-3-1.png


    You can grab it from github and test. It can bake dominant direction as well, but cannot bake RNM and SH, as grayscale AO won't benefit much from them.
     
    fuzzy3d, Tudor, keeponshading and 7 others like this.
  48. killmebboy

    killmebboy

    Joined:
    Mar 18, 2018
    Posts:
    6
    Hi
    Please allow me to use Google Translate to talk because my English is not very good.
    I encountered errors and problems while rendering.

    How can I solve it?

    This is the error I got.
    Also get this "error export scenario - see the console for details"
     

    Attached Files:

  49. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,667
    Try:
    - Disabling GI VRAM Optimization in advanced settings
    - Reducing texels per unit.
     
  50. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    please can we have an option to suppress these particular messages from speedtree objects? my scene has hundreds or even thousands of trees. trying to find other errors is very difficult with an error from every single tree in my scene.