Search Unity

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

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

  1. therewillbebrad

    therewillbebrad

    Joined:
    Mar 2, 2018
    Posts:
    140
    Shader 'Mikkel_LightMapped_1map': fallback shader 'VDiffuse' not found
    WARNING: Shader Unsupported: 'Hidden/ftBlack' - All passes removed
    WARNING: Shader Did you use #pragma only_renderers and omit this platform?
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/ftBlack' - Setting to default shader.
    <RI> Initializing input.


    Do any of you know what to do about this error?
     
  2. vice39

    vice39

    Joined:
    Nov 11, 2016
    Posts:
    81
    How do I enabled "Legacy denoiser" ?

    The manual refers to it, but I can't find that option anywhere.
     
  3. r8zbeh

    r8zbeh

    Joined:
    Dec 4, 2018
    Posts:
    16
    Its enabled by default , you can make sure by changing the "Setting " to Advanced . under "lightmapping tasks" there is a checkbox for that :)
     
  4. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Lightmapped Prefabs idea is to bake once, apply and instantiate many times, possibly in different scenes. If you want to use the same prefab with different lightmaps, just... don't use Lightmapped Prefab component. It should then work the same way as with any other scene object.

    Possibly. Baking it to a cubemap will bake the sun circle as well. But since you already have the sun as a directional light, you can end up with double exposure. Unity probably uses the sun-less version for its baked lighting, but there is no way to get it via script (or I'm not aware of any method). You can try just painting the sun over in photoshop with nearest sky color.

    Thanks - it makes things way, way easier.
    Also: https://docs.unity3d.com/2019.3/Documentation/ScriptReference/TerrainData-holesTexture.html
    Perfect. If I can just grab this texture and use it for cutout, it won't be hard to implement holes.

    Probably not. You may try using it for some interiors not lit by these dynamic sources though.

    Not caused by Unity. Can you try Legacy Denoiser checkbox?

    I don't know, but you can ask Dawie3565 or BenWoodford, they were playing with Amplify a lot.

    This is... not my shader.

    This is the one from Bakery, right. I can't see anything suspicious in ftBlack.shader. There is no #pragma only_renderers, it's as simple as it can be. If you select the shader, does it print a more specific error? Maybe your UnityShaderCompiler just crashed for some (unrelated) reason?

    You need to set Settings to Experimental, then scroll down to Legacy Denoiser checkbox:

    upload_2020-2-5_16-4-21.png


    There is a bug in v1.65 release which makes Legacy Denoiser checkbox uncheck every time the scene is opened (it is not saved). There is a patch for it on github.
     
  5. r8zbeh

    r8zbeh

    Joined:
    Dec 4, 2018
    Posts:
    16
    Hi guys .i've read your posts about ASE and Bakery SH mode which is an issue of mine too. and saw @BenWoodford asset which does not works with Standard ASE template.
    wanted to ask if was there any issue that you couldn't make this asset for Standard ASE template or its probable to tweak your Asset to work in Built-in render pipeline too.
    I'm asking cuz im not a programmer and can't evaluate how much effort it takes


    Update: I asked about the Baked GI node Option in ASE Standard Template and the developer of ASE answered :
    " What Baked GI node does is it fetches data from surrounding light probes, which is similar to our Indirect Diffuse Light node so you can use it instead. "

    so i changed the light model to Custom lighting as ASE manual said to use Indirect Diffuse Light
    and i got the error in below :

     
    Last edited: Feb 5, 2020
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    I think Ben's solution should work for Standard template the same way, as both Standard and Universal RP have the same limitation (no BakedGI override) and can be treated equally.
    Not exactly. We're talking about override baked GI slot which HDRP graphs have to allow writing user data as GI; not the baked GI node which provides built-in GI data.

    Refer to @BenWoodford :D That function should be there.
     
  7. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    79
    It is there, you should be using the custom node as that has the includes and in/out ports, though atm the results aren't entirely correct.
     
    guycalledfrank likes this.
  8. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    28
    The biggest problem is we got different results every time even with the same settings lol.
    Now we try to set sky intensity value lower for reducing the glitches.
     
    Last edited: Feb 7, 2020
  9. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Well,
    Let's give it a try, shall we?

    upload_2020-2-7_14-47-37.png

    I've just updated github (both -csharp and -compiled) with this feature. It is basically a tiled cookie texture you can set to directional lights.
     
    Last edited: Feb 7, 2020
  10. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    34
    I should have clarified that I am not using Lightmapped Prefab component, but using Group Selector component. For example: all small props using "LMGroup-Small", large props - "LMGroup-Large", etc.
     
  11. IvanNov3D

    IvanNov3D

    Joined:
    Aug 1, 2019
    Posts:
    5
    Hello everyone !
    I am trying to find a way to bake model in unity and then export it like GLB (GLTF) or at least FBX file with baked textures.
    Every time i try to export - i get not baked model fbx or glb...
    I know it must be very simple... but i cant find help after hours of research, could any one help me with this rout ?
    Thank you
     
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    LMGroups only affect the exact instances they are baked for in the scene. Copying the prefab with LMGroup around will lose the lightmaps (like with any non-prefabbed object).

    I know nothing about Unity->GLB export, but FBX exporter is now an official package. Assuming you tried it, you should also note that:
    - It probably doesn't export lightmap textures, but you can copy them manually.
    - It probably doesn't export renderer.lightmapScaleOffset which transforms uv2.

    It is possible to make a script that would apply lightmapScaleOffset into uv2 before export or make the exporter code take it into account (I haven't looked into it, but I did a similar modification for an OBJ exporter). Alternatively you can also use Bakery to render with Original UV mode, where UVs are assumed to be globally non-overlapping (if you pre-unwrapped the scene this way outside of Unity), then scaleOffset will be empty and can be ignored.
     
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    In the meantime, interactive preview is shaping up:









     
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,153
    Veeeeery nice, video rendered on what card?
    Available when? Need it NOW ;)
     
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    GTX 1060. Works just as fine with double-sized window, but that would be hard to use when also looking at Unity interface.

    This month? Next month? Not sure - there is still stuff to polish, and I was going to include other things in the update.

    Also I'm thinking it might be a separate paid plugin on top of Bakery (hopefully you guys won't hate me for that :eek:). The reasons are:
    - Bakery sales on its own are slowly decreasing because Unity users are not infinite.
    - I still want to focus on this project while being able to eat sometimes.
    - RTPreview is perfectly self-contained. Nothing in Bakery depends on it, it can be easily patched separately.
    - RTPreview is basically a whole separate renderer made from scratch - lots of work.
     
    keeponshading likes this.
  16. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    34
    Yes I know it. Need to avoid assigning a group to many prefabs each time, place them on different scenes and bake them there, in some cases override file the group inside scene.
     
  17. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    28
    It looks great.
    However we need to use a real cloud mesh and cast shadow instead of cookie.
    So that we can control the shadow's position precisely.
    We will test our objects and find out what causes the glitch.

    Thanks.
     
    guycalledfrank likes this.
  18. IvanNov3D

    IvanNov3D

    Joined:
    Aug 1, 2019
    Posts:
    5
    Thank you!
    Could you share link where can i find something like this ?
    OBJ with back staff inside will be great too for me.

    And more one question, what settings should i dig to fight with that gradient staff on models?
    askhelp.jpg
     
  19. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    OK, I can confirm it happens on all >= 2018.3 Unity versions due to mysterious mechanism of the new nested prefab system. For some reason component value is not saved. Actually seems to be related: https://forum.unity.com/threads/custom-editor-new-prefabs-how-to-setup-overrides.675310/

    So I added a call to PrefabUtility.RecordPrefabInstancePropertyModifications to my UI script. Can you try replacing the attached file?

    Theoretically you should be able to match a texture to the placement of your mesh clouds, like render your clouds from the sun perspective and use it at as a texture... but I understand it will require some trial and error until RTPreview release.

    Note that OBJ only supports one UV channel though. So it's either texture UVs or lightmap UVs. Are you sure that'll work for you?...

    Android project? See this: https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good
     

    Attached Files:

    Stanislawe likes this.
  20. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    15
    Hi
    I have a problem with bakery 1.6
    When I bake scene, static shadows was very good but all realtime shadows disappear !
    bakery Render Mode set to full lighting , Directional mode set to Dominate direction
    And my Pipeline render is LWRP
    pleas not to the dynamic red cube in picture below that realtime shadow disappear when bakery started to bake bakery.png
     
    Last edited: Feb 12, 2020
  21. fivestone

    fivestone

    Joined:
    Dec 17, 2013
    Posts:
    6
    When I render out lightmaps, certain meshes/parts of meshes are very dark, and some are completely white. The project is using URP on 2019.3.0f6

    Here's a quick flythrough of the scene, along with the bakery settings.


    Here's the import settings for the airplane and the hangar:
    LKkJvyPpyG.png
    jLhwVYsnCS.png

    Everything in the scene is static and the only lighting is a skylight. Here's its settings as well:
    3CRJS2rjej.png

    Is there a way to improve the lighting on these meshes?
     
    Last edited: Feb 12, 2020
  22. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Latest is 1.65, just saying...

    What behaviour did you expect?

    Full lighting = shadows are fully baked.

    So I guess you want to combine them. AFAIK LWRP (still?) doesn't support shadowmasks, so your option is to use Subtractive mode: https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html
    You'll need to set up the "shadow color" in Unity settings, then set Bakery to subtractive mode and bake.
    Note that Subtractive mode in Unity is fairly limited and only works with a single directional light and when your shadows have similar colors.
    In standard pipeline I highly recommend using shadowmasks instead.

    Please show me what Bakery's Checker Preview shows on these objects. Unity's "Baked Lightmap" checker is irrelevant (uses different algorithm).
     
  23. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    15
    I was expecting to leave dynamic object and just bake static not to obliterate the realtime shadow!
     
  24. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    15
    OK
    Thanks
    That's exactly what I was wrong with, I must to set Render Mode on Subtractive.
     
  25. sas67uss

    sas67uss

    Joined:
    Feb 8, 2020
    Posts:
    15
    Hi
    pleas not the below picture
    The middle shadow is static and the side shadows are realtime.
    When i move the dynamic object throughout the scene, its shadow is just like that .
    Render Mode= Subtractive
    While i set render mode on INDIRECT the realtime shadow looks very nice.
    unity2019.2.19 LWRP project .
    badShadow.png
     
    Last edited: Feb 14, 2020
  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
  27. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    What timeframe do you estimate for the terrain holes to be fixed?
     
  28. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Alright, I'm gonna do it today, so I don't forget it. Wish me luck :D
     
  29. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    Thanks, and good luck!
     
    guycalledfrank likes this.
  30. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    125
    Is this asset currently compatible with the 2019.3 release and URP?
     
  31. r8zbeh

    r8zbeh

    Joined:
    Dec 4, 2018
    Posts:
    16
    seems to have a minor UI issue . should ask @guycalledfrank when the next version gonno be out
     
    guycalledfrank likes this.
  32. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    UI issues were fixed today (it's on github).

    OK, it turned out harder than I though. Looks like even terrain diffuse map extraction is now broken in 2019.3. For some reason assigning any custom material to the terrain makes it textureless! Or at least completely ignores Base Map and never sets it to _MainTex.
    Because I have no idea how to extract the base map, I just used an orthographic camera to render the terrain with basemap-only shader, but now it doesn't work anymore.

    Pinging @jbooth, the great master of terrains - have you noticed any changes to custom shader compatibility in recent Unity versions?

    EDIT: Oh, OK. I think it now strictly requires the shader to have
    Dependency "BaseMapShader"    = "shader to render base map with"

    It didn't before. Fun fact: this line can reference the same shader it's written in.

    EDIT: terrain GI on 2019.3 was fixed: https://github.com/guycalledfrank/bakery-csharp/commit/335b6eb7fb6390cc5f3acd874444f4eebd7b9660
     
    Last edited: Feb 15, 2020
  33. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    208
    Well, there's a lot of pages to read :) I have a few quick questions, does the use IES profiles affect performance or are they simply used during the baking process?

    Additionally, for mesh lights vs emissive you mention in the docs emissive lights are free! Is this during runtime or baking process. If tight on performance should mesh lights be avoided, also if you have 10 strip lights for example will the system benefit if all the meshes are combined into 1 mesh even if the lights are in different locations in a scene? thanks
     
  34. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    OK, terrain holes are now on github:

    upload_2020-2-15_21-25-55.png

    Note: it currently only works if Terrain Optimization is off. Making it work with Terrain Optimization is possible, but will have performance implications. I'm leaving it for now.

    Only used during the baking process. They are pretty cheap.

    Baking, of course :) I just meant that baking emissives is faster.

    Baking will be faster, yes! Currently each light (including light meshes) is rendered in a separate pass. There is some overhead setting up these passes. If you bake many lights as a single Light Mesh, it will only require one pass.

    Fun fact: all lamps in this screenshot are a single Light Mesh:

     
    Stanislawe, Beloudest and Goldenvale like this.
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,865
    yeah, the terrain system has a lot of little hacks like this attempting to make it more modern while not really fixing much. It makes a lot of assumptions about your shader, even when it gives you a custom shader for the basemap, as anything world space won’t work, etc. What they should ultimately do is rewrite it as a package like SRP, with all of their shader features being supported by external plugins to the system. It shouldn’t assume you have a basemap, or let GI use that without you declaring that, or how your passes work in terms of splat mapping, etc, etc.
     
    Stanislawe and guycalledfrank like this.
  36. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    Thanks for fixing it! I've downloaded the Github version and tried importing it but it's giving me the following errors:
    Annotation 2020-02-15 231452.jpg
    Annotation 2020-02-15 235720.jpg
    I've already restarted Unity.
     
    Last edited: Feb 15, 2020
  37. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Github files are patches over the store version. You need to have original v1.65, then replace modified files.
     
    robocognito likes this.
  38. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    Yeah I realized that and tried it the way you suggested but it's still giving me the second error in my previous post:
    Annotation 2020-02-15 235720.jpg

    I did a fresh import, closed unity, replaced the files and started unity.
     
  39. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    189
    bakery interactive preview looks insane man. great work.
     
    guycalledfrank likes this.
  40. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    My bad! I forgot to commit some files. Fixed, please check again.

    Thanks! :)
     
    robocognito likes this.
  41. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    Thanks, that made it work again. I did a bake with terrain optimization off and the room is now properly lit but it's still leaving a seam where the hole intersects with a mesh.

    Annotation 2020-02-16 140718.jpg
     
  42. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Kinda looks like parts of the terrain are clipping through it. Maybe you just can't see them because of backface culling? Can you show me how it looks from the entrance, looking at these spots?

    upload_2020-2-16_17-40-11.png
     
    robocognito likes this.
  43. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    49
    I've checked and there's no terrain clipping through.
    Annotation 2020-02-16 164117.jpg

    There is a small gap between the terrain and the mesh though, could it being this close cause the shadowing?
    Annotation 2020-02-16 164953.jpg
     
    Last edited: Feb 16, 2020
    guycalledfrank likes this.
  44. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    56
    Any progress on the Lightmap profile (script works good but would be nice to have a single interface so that our artists can do those setups without much hassle). Working a short deadline project where we switch lighting at runtime just like Unity's default realtime lighting scenario.
     
  45. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,198
    Hmm I can't reproduce it in a similar scene. I thought maybe there was some half-texel error with the holes, but it's not the case. If you can send me any package (terrain + mesh) which shows this bug, will debug.

    No progress on that. Did you try ECone's lightmap swapper? https://geom.io/bakery/wiki/index.p...ions#Lightmap_Swapper_.26_Light_Probe_Storage
     
  46. E1ON

    E1ON

    Joined:
    Sep 30, 2018
    Posts:
    1
    Hello, Lightmap not displayed in Baked lightmap mode | UV overlap. How to solve this problem?
    13.png 12.png
     
  47. SmashedAvocado

    SmashedAvocado

    Joined:
    Dec 19, 2013
    Posts:
    37
    Just wanted to say that I'm really enjoying Bakery and it's working really well for my current project. The lightmapping is much faster than Progressive GPU and the results are great. So thank you!

    I'm also using the lightmaps on prefabs, but not with the included prefab script. I'm using the code here: https://github.com/Ayfel/PrefabLightmapping which works well with nested prefabs (after minor tweaking).
     
    guycalledfrank likes this.
  48. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    52
    Is there some intensity cutoff value for meshlights?
    When shining a mesh light at a shallow angle at a wall we get at some point a pretty hard edge where it stops which is quite visible.
     
  49. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    34
    Thanks! It works.
    Now I noticed similar case when edit component on many of selected prefabs in Project window. But it not corrupt my workflow. Just to know.
     

    Attached Files:

    guycalledfrank likes this.
  50. marenin

    marenin

    Joined:
    Sep 22, 2019
    Posts:
    2
    Got a issue with atlas packing.
    Using LightMapGroupSelector and atlas packing work like this(with auto-atlasing and TexelsPerUnit=1, got near same results):

    Fow example if one of meshes have lightmap scale at 20:


    I think the atlas-packer when using LightMapGroups should fill the whole space, but it doesn't.
    All meshes in scene have scale 1, almost no hierarchy with 0 transforms, individual uv0 for texture, proper individual uv1 for lightmap.
    Is there a solution to this issue, what am i missing?
     
    Last edited: Feb 18, 2020 at 4:03 PM
unityunity