Search Unity

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

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

  1. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hello,

    i did an fast test and converted the new Unity Standard scene to reasonable parameters. Standard exposure workflow. It was all cranked up per default.

    The Bakery RT preview looks nice. This is an absolut game changer and speeds up the setup by factors.

    preview.JPG

    i set intensity 100 to the DefaultHDRISky for the BakerySkyLight.

    HDRSKY.JPG

    and the Bakery Direct Light to 10

    DL.JPG

    to get this nice Bakery RT preview.
    I also added Bakery Point light to the SpotLights per multiselection.

    What I get after indirect Bake with L1 probes with these parameters are these Lightmaps and Probes. Nice.
    But the Game view looks like this.

    id000.JPG

    I have to add an Indirect Lighting Controller (Screenshot left side)
    and set it to 200.
    Then it looks great.

    id200.JPG

    Do i do something wrong here?
    Why i must set the indirect lighting to 200?
    I was happy that i found it but i thinks i should be possible without.

    I am on latest Bakery Github Repro and HDRP 10.1.0 in Unity 2020.2.0b8.
     
    blueivy and guycalledfrank like this.
  2. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    btw the lightmaps looks like this

    lightmaps.JPG
     
  3. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Hi, I've a desert scene, I would like to bake just the terrain, at least for now.

    When hit bake it tells me that its going to bake 115 lightmaps which sseems like its going to be too much so I cancel.

    I lowered the terrain's lightmap scale but I keep getting the same number.

    How coul dI just render the terrain, while still receiving indirect from other objects (without setting other objects lightmap scale to 0), like "just bake this selected object" ¿?.

    "Render selected groups" having terrain selected seems not to help.

    tx

    edit I create da group with the terrain, lowered a lot the texels per unit and it crasehd but I may retry at some other point.
     
    Last edited: Oct 26, 2020
  4. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    some more shots to explain my problem with the indirect light controler crank up to 200 from

    https://forum.unity.com/threads/bak...tpreview-released.536008/page-95#post-6453390

    outputs
    Unity PLM (left) vs Bakery (right)

    note the Lighting Exposure Corrections in Scene Window and on Lightmap Preview
    -9.7 PLM (without i see pure white on every outout)
    -0.6 Bakery

    Bake setting also in the window.

    I only corrected Directional Light and DefaultIBL to reasoinable parameters for Bakery bake.



    B01.JPG

    B02.JPG

    Note: PLM does not bake LOD from rocks and plants.
    B03.JPG

    B04.JPG

    B06.JPG

    I really cannot get why the Standard PLM setup works wit these strange exposure values and i must why set exposure to -10 to get an preview output. Also the exposure corrections in the post volumes are needed with complete strange values.
    For Bakery i correctet to Physical camera values and expoure settings around 0.

    Anyone an idea?
     
    Last edited: Oct 25, 2020
    guycalledfrank likes this.
  5. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Is ist possible to use the HDRP SH nodes with a vector 3 instead of a texture? I'm trying to use the normal from the Virtual Texturing stack to produce sh lightmaps and would like to reuse the sampled data instead of having a duplicate normal map just for this purpose.
     
  6. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    Hi, first time using Bakery. My current project has a realtime daylight system. Would it possible to use bakery only to bake ambient occlusion on static objects and scenery and still be able to change the scene ambient color and get dynamic sun shadows and lighting?
     
  7. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    FYI and a question.

    I tested the vegetation engine and it s an great set of amplify shaders who can run nearly any vegetation assets from the store after conversion with wind and advanced seasons on BuiltIn, URP and HDRP.

    Test Scene from video for download available in video description


    and what comes next....



    Because it is so versatile I would to know if you baked these voxel trees with your new Light Probe 3D textures (irradiance volumes).



    and if yes when it would be possible to generate an amplify function the easy way for these vegetation engine amplify shaders?
     
    Last edited: Oct 26, 2020
    guycalledfrank likes this.
  8. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    @keeponshading Hi there. Thanks for the email. I was actually looking at how good Book of the Dead looks with occlusion probes and one week later I get this :)
    I would be interested in adding support, it that's a possibility. It would really help to bring all the lighting together.
    I'm still busy with the next update, but I'll get in touch with the dev in the following days ;)
     
    guycalledfrank and keeponshading like this.
  9. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hey. I did this Occlusion Probe Test with your old set of Amplify Shaders some while ago.
    https://forum.unity.com/threads/rel...s-gpu-wind-shaders.531668/page-3#post-4716548
    Therefore i used the Bakery Occlusion Probe trigger in the UI.

    But the experimental Light Probe 3D textures (irradiance volumes)
    from Mr F have so much potential.
    https://forum.unity.com/threads/bak...tpreview-released.536008/page-88#post-5880422
    I did some early tests who really rock.

    At the end of this post you can find the Shader (testSHVolumes.shader)
    https://forum.unity.com/threads/bak...tpreview-released.536008/page-88#post-5900201

    Let s see what Mr. F says to it.
    First i really wanted to know if the Combining multiple trees with lighting baked to voxels demo uses these Light Probe 3D textures (irradiance volumes)?


    FYI
    Another older topic.
    Bake LOD vegetation geo the normal way.

    I sent Mr F these Assets this setup of Book of the Dead Assets a while ago. upload_2019-12-16_15-34-53.png

    The rocks and vegetation all have LOD´s and he managed to bake and pack the lightmaps really dense after some investigation.
    So Bakery can also bake this LOD vegetation stuff now really fast and pack it all together.

    One 4K map can hold several trees and lots of square meters gras now.
    There was a post on discoord after he solved it but i cannot find it anymore.

    So left Unitys Progressive.
    Right Bakery. Rocks and Vegetation has LOD and are baked nicely now.
    I tested this it yesterday.

    B04.JPG

    id200.JPG


    Last but not least there is this great Bakery Community Extension who allows bake to vertex and instancing.

    Vertex Lightmap To Mesh Asset
    (by Mr F)

    Download

    Vertex color baking uses additionalVertexStreams to bind an additional vertex buffer to the graphics pipeline without breaking the link with the original mesh asset; but additionalVertexStreams cannot be batched/instanced.

    This tool adds "Bakery/Utilities/New mesh asset with vertex color" menu option that'll generate a new complete mesh asset out of every selected GameObject having MeshRenderer/MeshFilter. These can be then used with batching.

    New assets are saved to Assets/VCMesh folder.

    https://geom.io/bakery/wiki/index.php?title=Community_extensions
     
    Last edited: Oct 26, 2020
    blueivy and guycalledfrank like this.
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    sweet, is it more costly than lightprobes?
    i benched LPPV on switch and these are way costlier, I guess it's the same 3d texture lookup, just wanted to check.
     
    keeponshading likes this.
  11. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    I just bought it, when it works it's fantastic. Far superior stability, quality and speed to GPU progressive.
    I have a few questions and I'm running into problems with one scene
    1. on one scene RT preview won't start, no error code. it shows the
    2. one light, the sky light should have no shadow, how do i set up the Bakery Direct Light component for that?
    3. when RT works, the geometry is very angular as if normal smoothness wasn't taken into account
    4. reflection probe is not automatically refreshed on baking so each time I forget to press the button and it looks off, i don't see what benefit there is in not automatizing this so I think it should be automatic.
    5. bakery light mesh should function with emission map of URP materials, currently it's complaining that the material should be unlit. emission is unlit.
    6. show checker shows non static objects
    7. the asset folders are in the root, i read that they can be moved elsewhere, will update from the package manager displace those or will it understand by the meta files that these are the same files and the new location?
    8. bakery lightmaps are stored in a new folder that's in the root: very inconvenient as it pollutes the root of project. Instead it should be stored in the scene folder where builtin lightmaps and navmesh and occlusions are stored.
    9. i tried to delete the bakery folders to re install clean and error happens
    RT previs not working:
    bakery rt no wanna.gif
    mesh light:
    upload_2020-10-26_22-59-44.png
    show checker:
    upload_2020-10-26_23-2-30.png
    some times RT casts this error:
    upload_2020-10-26_23-10-0.png
    error on delete Editor folder:
    upload_2020-10-26_23-11-40.png
     
    Last edited: Oct 27, 2020
    guycalledfrank likes this.
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    and after i deleted the editor folder from the file browser of windows and then reinstalled bakery I'm getting this error (i'm not importing the examples)
    upload_2020-10-26_23-20-56.png
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    and baking a scene that used to work is stuck there
    upload_2020-10-26_23-37-50.png
    could be related
    upload_2020-10-26_23-38-8.png
    that windows cannot be canceled so i need to exit unity :(
    after restart it worked on one scene then broke again on another
    it left an etron on the console, hope this helps
    upload_2020-10-27_0-3-13.png
    note: I use 2020.1.10
     
    Last edited: Oct 27, 2020
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Not sure if it's possible or not - Lightmapped Prefabs only store lightmap-related data. Reflection probes are managed completely by the engine and I don't know if engine allows dynamically creating/moving them. Basically if it works without Bakery, it'll work with it.

    Hmm is it Unity 5.6? Lighting data asset patching for shadowmasked point lights in 5.6 may be a bit flaky - even on 2017 you shouldn't have this problem. I gave up fixing this, as Unity doesn't want to disclose the format or provide any API for it, and newer version have ways to avoid it.

    No idea then. These arrays must have data. The data is set during the bake (you can see "probes.bakedProbes = " in ftRenderLightmap.cs) and then stored forever in the lighting data asset associated with the scene:

    upload_2020-10-27_15-29-51.png

    Maybe LightmapSettings.lightProbes.count returns something weird? Have you tried bakedProbes.Length? Maybe you're calling this code when the asset is not yet set?

    It shouldn't be. Any more details about your lights' setup?

    Not sure I understand your concern. To me it looks like the cubemap is rotated the way I'd expect it to:



    Doesn't it work the same in your scene? If it doesn't, maybe try updating from github.

    Add ambient light?
    Tried Skylight?

    I didn't work with MeshBaker, but apparently it just overlayed all subobjects' UVs on top of each other. It needs to re-pack lightmap UVs after mesh combining. Check if there is any option for that (I'm pretty sure it must have some).

    Was fixed, please update from github

    Delete them :D

    They should work. In case you get light leaking through walls onto dynamic objects, make sure to also enable "occlusion probes" checkbox. These approximate shadows from realtime lights on top of "regular" light probes only storing indirect illumination.

    1. Install from the store.
    2. Follow the instructions to patch it with github files on top: https://geom.io/bakery/wiki/index.php?title=Github_access
     
    marenin likes this.
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Nice scene! I think I missed when it was released. What is the shader used on the leaves? :D

    Did you touch the exposure in RTPreview, or was it set to 1?
    Then the lightmap must have similar intensity to what you saw there. Possibly you have postprocessing exposure darkening the image too much. How does it look without any post-processing?

    Can get better if you enable hole filling :)

    Terrain's scale in lightmap is respected. Possibly you just didn't decrease it enough; it could be assigned massive resolution (which is then just clamped by Max Resolution) by texels per unit. You can try some ridiculous values like 0.0001 to make a noticeable difference.

    Setting other objects' scale in lightmap to 0 is the only option for now.

    Currently terrains cannot be a part of a lightmap group.

    ... but I probably forgot to add a check for it...

    If you have a world-space normal, you can replace this bit with your own input:

    upload_2020-10-27_16-40-42.png
     
  16. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Bake ambient occlusion: yes.
    Dynamic sun: yes.
    Dynamic ambient color: you'll need to write a shader that would multiply lightmap AO by this color. Maybe there is an easier way, but it's a first thing that comes to my mind...

    Grass is PRETTY!

    I did.
    Originally I was using per-vertex baking for the trees, but eventually it became too much data. Probe volumes are more sparse, but still give enough precision; additionally the same volume is used to light all dynamic objects.
    And all your LOD levels can read lighting from the same volume.

    Who knows? I'm not an expert in Amplify.
    But sampling these volumes is pretty easy in the shader, so I guess it shouldn't be too hard to integrate it to Amplify as well.

    BTW, with latest github patches you can also get shadowmasks in a separate 3D texture, meaning you can replace Unity's regular occlusion probes with them.
    You can find them in GetComponent<BakeryVolume>().bakedMask.
    They provide decent shadow approximation for distant objects:

    upload_2020-10-27_16-52-18.png

    upload_2020-10-27_16-52-47.png

    Reading multiple volume textures is certainly more expensive than using single per-object value. It can be noticeable on mobile, but no so much on PC/consoles. The cost is proportional to the amount of pixels executing this shader - so if your dynamic objects don't have huge screen area, it may still be viable.
    Also AFAIK Unity's LPPV uses full floating point textures (?), while Bakery uses half-floats.
    Another difference is: Bakery volumes are never updated in runtime. They are static assets. LPPV is refreshed dynamically when an object moves if I understood it correctly.
    The best answer is to test :)

    Is there any message in the bottom of .ftracelog.txt after it happens? If it mentions something about probes, please try updating from github (specifically bakery-rtpreview-csharp repository), or, as a quick workaround, set light probe mode to Legacy.

    Skylight always has a shadow. But for direct light you can disable it by setting shadow samples to 0 (mentioned in the docs).

    It uses your geometry normals directly, but it doesn't use your normal maps (unless in Baked Normal Maps mode). Are you sure it's the normals being "angular" and not low resolution UV seams?

    Maybe. Originally I separated it because it's essentially a non-Bakery function; probes are rendered by the engine itself. But from the UX perspective you are right - I'll try to tidy it up.

    These complaints are more for self-validation, to make sure your emission color and your lighting match each other. Ignoring these complaints is okay if you know they match. Unlit shaders are just a safe bet because they never mix anything extra into the only value they display; for example, if your material has white albedo AND bright emission, then it may actually be brighter than the emissive color alone, as albedo, illuminated by the lights, will add to combined emission.

    I know, but I didn't find the way to avoid it (apart from setting a constant on every dynamic object, which I wanted to avoid for performance). Usually it's not a big problem, as you can recognize irrelevant (dynamic) objects and don't pay attention to them.

    Yes, folders can be moved, but I'm not sure if Unity package importing will respect it and not try to import a second copy to Assets...

    Tried this? https://geom.io/bakery/wiki/index.php?title=Manual#Use_scene_named_output_path

    Caused by forcing Unity to render reflection probes via internal method - can be safely ignored though.

    Restart Unity. It locks DLL files on first use and these cannot be deleted until restart.

    upload_2020-10-27_17-18-18.png

    Apparently you didn't delete everything. Otherwise you wouldn't get errors from a Bakery shader...

    Update from github?
    (Related fix: https://github.com/guycalledfrank/bakery-csharp/commit/5bb66c9415cf848cef0a6fb3d603fedf01721139)
     
    laurentlavigne likes this.
  17. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    No it's tangent space, but already sampled, think of it as a normal that I already processed, and would normally connect to the master node, but instead I want to pass it through your node. Can I just replace the sampling process in your subgraph with the normal directly, or will this break something ?
     
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Right. Then you'll need to replace the PerPixelWorldNormal subgraph. There is nothing fancy, it just transforms the normal from tangent to world, so just... try replacing "Sample Texture 2D" with your own input?

    upload_2020-10-27_17-28-59.png


    It makes sense having a vector as input as default option - I'll probably make it this way in future releases!
     
  19. Juanola_

    Juanola_

    Joined:
    Sep 29, 2015
    Posts:
    38
    Hello!

    Is it possible to bake lighting into a whole timeline sequence? I have a movie to be played in the Oculus Quest, and I the lighting will always be the same in the whole scene. Is there any way I can bake all the lighting into all the moving objects?

    Thanks!
     
  20. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    If objects move, but lighting doesn't change, it should be possible. If you mark objects to "Contribute GI" but don't set other static flags, they should still be movable.
     
  21. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    Thanks for the replies! That was fast :)
    I updated all bakery to the github and that seems to have resolved a lot of the issues.

    Will do. Is there a ready made sample scene I can just build?
    And can the volume be written to? I like to use lightprobe.AddDirectionalLight() API to simulate dynamic area light.

    As you can see the shadow blurriness doesn't match. Is there a way to make RT preview to look more like final view?
    (don't worry about the colors not matching, it's URP, render feature = rufat's color correction PP+bloom)

    upload_2020-10-27_9-35-15.png
    Also notice how the orange box at the left of the cylinder in the middle is gray on the RT preview, I'm using a URP lit shader so the meta should output albedo texture, which then should show up on RT.

    Something I'd like to see is x2, x4 under sampling. What this does is display the window at 1:1 scene view but render only x4 x16 less and blow them up to fit the viewport. This is very useful as it gives a faster preview of the color composition and is easier for the eye to see. You can see how much better this is by squinting: the brain no longer tries to understand the contrasts cause by the tiny black dots.
    Alternatively, instead of small dots you can render big squares that decrease in size as the render converges. They used to do that a long time ago in Raydream and other raytracers.
     

    Attached Files:

  22. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    I retextured the cylinder which is the part left and above the yellow box
    Why is not catching any baked light?
    with static batching on (baked light)
    upload_2020-10-27_16-52-59.png

    batching static OFF (no baked light)
    upload_2020-10-27_16-48-37.png
    if i apply a generic gray material and turn smoothness to 0
    upload_2020-10-27_16-56-32.png
    so what i'm seeing here is the sun doesn't affter the look of this particular object but the emissive mesh that's in the center does.
    the object below shows lighting properly as shown with the generic gray material. same settings
    upload_2020-10-27_17-0-9.png
    the preview gets it right so I don't know what's happening
    upload_2020-10-27_17-1-26.png
    and the checker show that the object that's not lightmapping is considered by the bakery as should be lightmapped
     
  23. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    Hi, we would like to use Bakery for our upcoming production, but we're hitting a few bugs. It feels fairly unstable, any help?

    My GPU: NVidia RTX 2060
    Scene size: Small. Two 2048x2048 lightmaps. 20x20x20 meters dimensions.

    1. I constantly get this error when trying to bake. Perhaps 50% of the time?
    Afterwards, the "rendering lightmaps - preparing" box shows, and cannot be cancelled (it just re-appears). I have to restart Unity.
    upload_2020-10-28_10-9-49.png

    2. Denoising takes ages, multiple minutes to compute even a single pass. It was fast, the first time I tested Bakery, but now it's slow, even after restarting Unity. Is it bottlenecked on something?
    Edit: Eventually denoising errored out with the error, below, after popping up some other error window for a few milliseconds.
    Edit 2: I've noticed this is specifically when denoising "Dominant direction" directional maps. Denoising is instant, with that setting turned to "None".
    upload_2020-10-28_10-15-48.png

    3. When using XAtlas, Unity hangs on import.
    I did a bake with XAtlas, with worked out just fine. However, when Unity tries to reimport one of our models (with the new XAtlas metadata stored in the .meta file), the importer never finishes, and I have to force quit Unity. The only way to fix this was to reset the asset file and bakery settings so that those metadata values were cleared. This issue was not always reproducable, and not on every model.

    4. Preview mode crashing.
    Often (usually after a bake?) preview mode will open and then immediately close. No clue why. You have to restart Unity. I understand this is an experimental feature, but I thought I would mention it.

    5. Any way to save bake settings (per scene)? When I change the baking settings, nothing changes within Git. Which is problematic if someone else wants to change something in the scene, and then rebake the lighting. Did I accidentally ignore the settings file somewhere?
     
    Last edited: Oct 28, 2020
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    @Kleptine update the files from the github private repo. request access first https://geom.io/bakery/wiki/index.php?title=Github_access
    Use LFS and clone the repos, don't use the zip or you'll have problems.
    Also pay attention to your VRAM, if you use RT preview for example it'll eat up a lot of vram so you may need to close some apps that use the GPU a lot, like today I had to turn off Substance Painter because it does everything on the GPU.
    upload_2020-10-29_0-50-21.png
     
    Last edited: Oct 29, 2020
  25. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937

    You can get the scene when you create an empty HDRP project in Unity 2020.2.0b8.
    It s an great bake test scenario because of outside area , inside room with window and closed room only with lights and lightprobes.

    The leave material is a Standard HDRP Lit, Material Type set to Subsurface Scattering with an Foliage Diffusion profile. The Bamboo is an HDRP Lit Tesselation.

    Leave.JPG


    The problem is the standard setup.
    The lightmaps are all complete white at exposure 0.
    Yu must go -13 exposurre to review the lightmaps.

    01.JPG

    because it baked with
    Directional Light 100 000Lux

    02.JPG

    HDRI Sky Exposure 13.5
    03.JPG

    and the post processing set to 11
    2.JPG


    The problem now is that Bakery does not like these high values after standard value conversion . The out cominglightmaps are unusable.
    Why your baking algorithm has these problems?
    It s the same problem you descibed in your FAQ.

    Therefore i setup Bakery bake with "normal", lower values for Dir Light and Skylight IBL.
    The problem is that you must redo all the post process settings to this lower setiings.

    It would be much better you can convert the light intensities instead of doing a new setup.
     
    Last edited: Oct 29, 2020
    guycalledfrank likes this.
  26. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Therefore i talked with BOXOPHOBIC. He answered here.
    https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-71-rtpreview-released.

    He is an Amplify Pro and did the Vegetation Engine Asset i showed you here
    https://forum.unity.com/threads/bak...tpreview-released.536008/page-95#post-6455755
    Think it would be easy for him.

    Is there a simple shader somewhere who reads the separate Shadow from the texture.
    I only have the old one you sent to me some months before?
     
    Last edited: Oct 30, 2020
  27. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    I think this is a bug:
    When I bake one scene (A) it's perfect
    If I load another scene (B) then go back to scene A it's perfect
    but if I bake scene B then going back to scene A results in some of the lightmaps scrambled
    upload_2020-10-29_23-6-11.png
    verification that it's the lightmap and now my texture:
    upload_2020-10-29_23-6-44.png
    options:
    upload_2020-10-29_23-7-49.png
     
  28. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    After a few days trying to work this out (unsuccesful) I can't make sense of this bug ^
    It only happens on trees which share the same cutout URP lit shader.
    Here I've turned unity GI back on to see what lightmap they point to, it is the right map but it keeps changing tiling and offset. The bug also happens with unity GI off.
    I bake this scene
    upload_2020-11-1_12-10-10.png
    exit unity, reload
    upload_2020-11-1_12-12-33.png
    notice how the baked lightmap tiling and offset are different.
    The weird thing is, if I add a sphere with the same pine material this will retain its lightmap info
    upload_2020-11-1_12-42-44.png
    So something about this pine object keeps resetting lightmap coordinates but only with The Bakery.
    So maybe something gets overriden by the asset pipeline. I checked and I have zero asset pipeline running, I used to a week ago. No idea. @guycalledfrank any idea? known bug?
     

    Attached Files:

  29. Krt1

    Krt1

    Joined:
    Nov 25, 2017
    Posts:
    4
    Hi, I am working with URP and I have a problem when I want to bake a prefab with a vfx graph. For baking to work, disabling the VFX component is not enough, I have to remove it. Could there be a conflict between VFX and Bakery? Here is the error message I get
     

    Attached Files:

  30. Alexpi8

    Alexpi8

    Joined:
    Jan 31, 2014
    Posts:
    3
    Hi,

    With the new amd radeon 6xxx cards having RT, will it be support by Bakery?
     
  31. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    I am on the fence about buying, I just got myself an RTX 3070 and would love to test this thing out however I'm a bit torn because in HDRP the graphics in real time are so good that I am not sure if there's a place for lightmaps.
    Does anyone have sample of this working well in a mixed lighting mode in HDRP or would I be better of just using realtime shaders. As far as I am aware all the lightmappers are trash in Unity built-in but I'm sick of spending money to fix what shouldn't be broken so sorry if I'm a bit reluctant.
     
  32. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Your lightmapped objects are too low-res. The shadows are only blurry because of low resolution. Increase texels per unit.

    Try updating from github - it was rare (triggered by something in the scene?) but was recently fixed: https://geom.io/bakery/wiki/index.php?title=Github_access

    It should be fast normally. But Optix denoiser is also too dependent on driver version and particular GPU model, and it's hard to debug it. If you update from github, try using Open Image Denoise instead:

    upload_2020-11-2_19-33-58.png

    Alternatively, in ftRenderLightmap.cs find this line:

    const bool alternativeDenoiseDir = false;

    and change false to true. This will still denoise with Optix, but in a somewhat different way.

    As unwrapper or as atlas packer? Using xatlas as unwrapper can indeed make it stuck for a long time with some models it doesn't like. I can't do much about it, as I'm not xatlas' author. Using xatlas as atlas packer is usually nicer though.

    Was fixed (see bakery-rtpreview-csharp repository).

    They are always per scene and saved within the scene file itself. Not sure why your git doesn't see scene file's changes :confused:

    Why? There shouldn't be any problem updating via github zip. Just make sure to respect these guidelines: https://geom.io/bakery/wiki/index.php?title=Manual#Upgrading_Bakery

    I'm pretty sure any algorithm will have a precision problem when lights have 100k intensities. And I'm pretty sure Progressive scales these values down under the hood.
    Apart from that, Bakery also stores much of its intermediate lighting data in half-floats, which have even lower precision, but it's worth the speedup and doesn't show any precision difference when working in "sane" intensity ranges.

    This shader needs to compute directional lighting on its own, so it must be "unlit", not "surface" or any lit graph. Then just do something like that:

    color.rgb += saturate(dot(normal, _WorldSpaceLightPos0)) * _LightColor0 * tex3D(_VolumeMask, volumeUV).r;


    Here I'm assuming that:
    - _WorldSpaceLightPos0 represents main directional light's direction.
    - _LightColor0 is its color.
    - _VolumeMask is volume.bakedMask
    - volumeUV is the same UV you use for GI volumes.
    - Directional light's shadowmask is set to R channel.

    https://geom.io/bakery/wiki/index.p..._in_one_scene_breaks_its_UVs_in_another_scene

    Not sure I get what's going on here. Does it happen on a simpler scene (e.g. one pine tree on a plane)? It'd help if you can send me a scene that I can try/debug.

    Are you sure it doesn't work after you apply changes?

    upload_2020-11-2_20-8-5.png


    If it does not, then yes, sounds like some weird conflict.
    The "errors" in prefab UI are not real errors though - they are only to prevent you from accidentally overwriting a prefab you didn't want to overwrite.
    As a quick workaround, you can skip this validation by opening BakeryLightmappedPrefab.cs and adding

    return true;


    just after

        public bool IsValid()
    {


    Not planned yet.

    True. Just make sure your audience has the hardware to run it.
     
    Last edited: Nov 2, 2020
    laurentlavigne likes this.
  33. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Right now I have decided not to use Ray Tracing because there's still many people that are on DX11 which means I will have to use in HDRP the progressive bake or Bakery. As far as I am aware there is no real time GI except Ray Tracing and there aren't any other options right for GI?

    So the main question I have is how does Bakery compare to the built-in progressive in 2020.1, I have heard a lot of good things about it but I would like a direct answer from you thanks.
     
  34. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    Any way to do that on the object only? like Scale in lightmap (grayed out because i turned off unity's light baker). I didn't find a lightmap scale or texel control in the Bakery lightmap group component.

    Thanks, this is now solved by turning adjust padding OFF. The trees size varies a lot from scene to scene.

    Problem when using the batch baker I get this:
    upload_2020-11-2_12-15-41.png
    the light maps are not stored
    upload_2020-11-2_12-16-6.png
    options seem correct though, any idea?
    upload_2020-11-2_12-16-24.png
     
  35. Krt1

    Krt1

    Joined:
    Nov 25, 2017
    Posts:
    4
    Applying the changes to the prefab does not solve the problem. However, thanks for the boolean tip ;)
     
    guycalledfrank likes this.
  36. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Hi, I don't know if this problem is already fixed or someone answered it already but I am facing a problem with Bakery Lightmapper (Well, I think this isn't bakery causing problem may be). As you all know that if 2 objects share same material, they get batched by Unity's Static batching. Here comes the problem, if two objects share same material but doesn't share same lightmap, Unity won't batch them together. Same is the case with my environment. A Lot of buildings share the same material but Bakery isn't adding them to same lightmap. My question here is that is there any possible solution for this that could fix it? Without lightmapping 1201 batches are saved but with lightmapping, only ~200 batches are saved. Anyone with a solution, please reply. Thanks.

    EDIT: Fixed the problem. This could help someone so the solution that worked for me was really simple. In Bakery Render settings, there's a drop down of "Asset UV processing" which by default I think was on "Adjust UV Padding" but I, for some lightmap issues, set it to Adjust UV padding which so far was working fine but then this batching issue popped up, so I changed it to "Remove UV adjustments" and simply worked for me. Now, same objects are using same Lightmaps. :)
    Really to this Bakery asset, sorry for that. :D
     
    Last edited: Nov 4, 2020
    guycalledfrank likes this.
  37. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    What you're asking for is unfortunately impossible. Static batching works by combing two meshes into a single mesh. That single mesh can only have one set of textures when it renders, and only one lightmap.
     
  38. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Thank you for your reply. Yes that's the problem, texture is single, one texture but Unity is baking them into separate/different lightmaps. How can I make unity bake them into single lightmap?
    Is there something to do with Bakery settings? 'Cause as far as I remember and know, this never happened with Unity lightmapping.
     
  39. jdzzdh

    jdzzdh

    Joined:
    Feb 25, 2014
    Posts:
    1
    I encountered a problem in a test scene: when two planes intersect, a black gap is formed at the junction. I purchased the source code of bakery 1.7 but did not change it. This phenomenon is caused by the replacement of ftrace.exe (ONLY this file) compiled from the source code. Can anyone provide some clues?
     
  40. aloneandsuffering101

    aloneandsuffering101

    Joined:
    Apr 21, 2018
    Posts:
    15
    Just wondering before I upgrade will this support RTX 3070 ?
     
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,671
    Hmmm? Scale in Lightmap is what I use. Just checked it in Unity 2020.1.2, and it's still there. Even disabling "Baked global illumination" in the lighting window still leaves it un-grayed for me. How exactly did you turn it off?

    Judging by your github issue, you had the infamous "probes refusing to be rebaked after normal render" problem, so please update to the latest patch from github: https://geom.io/bakery/wiki/index.php?title=Github_access

    With L1 light probe mode it's also safe to uncheck "render light probes", they'll be still rendered during normal render.

    Interesting, wouldn't expect that.
    Batching works better when you have fewer lightmaps. I have some general advice on decreasing lightmap count: https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_too_many_lightmaps

    If you want to really force a group of objects to bake into a literally single lightmap, just use lightmap groups, they are made for this:
    https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector

    Putting a group selector with a group on a parent object will force everything in the hierarchy to use one map. Texels per units or min/max resolution options will be ignored.

    I answered you on Discord recently. Was the issue resolved?

    Good question. My friend ran some tests and it seems the difference between 2xxx and 3xxx is not as significant. It also seems that 3xxx only works in RTX mode, same happens to OptiX denoiser (throws errors in non-RTX - apparently old OptiX version is not properly supported by 3xxx drivers? For denoising there is also OpenImageDenoise in the latest patch, it works everywhere).

    I'll update lightmapper/denoiser using latest libraries this week and see if it brings any improvement.
     
    fuzzy3d likes this.
  42. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    maybe a URP bug?

    upload_2020-11-10_0-47-47.png
    upload_2020-11-10_0-49-22.png
     
  43. krakentanz

    krakentanz

    Joined:
    Aug 13, 2020
    Posts:
    34
    Hey Arthur,
    bought Bakery the other day. What a refreshing piece of software, thank you so much!
    I have the following lighting-and-model-switching issue and wanted to know if you can think of a way to solve it with Bakery:
    We have an asset -in this case a house- that was modeled in three different styles ranging from super detailled to very coarse (you can think of it as extreme LODs: they look different but take up roughly the same 3d space).
    Within our level dozens of instances of this house asset are scattered around and are lit differently with a bunch of light sources. Now at runtime, I want to be able to switch individual object's style (i.e. replacing the detailed with the coarse mesh) independent of the other houses and still have the correct baked lighting displayed on all objects.
    I saw that Bakery supports lightmaps per prefab, what I would need though is something like "lightmap per scene object", allowing for different light situations. Is this at all possible?

    Thanks a bunch!
    Felix
     
    guycalledfrank likes this.
  44. Karol_S20M

    Karol_S20M

    Joined:
    Oct 2, 2020
    Posts:
    3
    Hi guys, I am experiencing problem with using Bakery with Unity Collab. All maps are copied between the machines but the scene on the target machine is very dark and I am receving red errors saying that the map files can't be accessed. Is anyone one experienced this issue? Thanks
     

    Attached Files:

  45. Karol_S20M

    Karol_S20M

    Joined:
    Oct 2, 2020
    Posts:
    3
    Another question, in the docs it states that Bakery can utilize multiple GPUs out of the box, though when I am baking with 2x 2060 SUPER my second card is idling.
     
  46. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    I think there is a serious compatibility issue of Bakery with the new RTX 30XX cards. After installing a new RTX 3070 card three days ago, I started getting random system crashes after opening a project with Bakery plugin. These crashes kill not only Unity editor, but affect all other open programs, either causing graphics artifacts or shutting them down completely. These crashes happen immediately after launch of Unity or a few minutes/hours later, in idle Unity editor (not during baking).

    Because each test run to investigate the issue basically requires just sitting in front of idle Unity editor and waiting for a few hours, I didn't find yet any reliable method to trigger this crash manually, and/or exact conditions/settings for it. My understanding is that Bakery has some background functionality (injecting hidden objects into scene, which run in background mode and launch some tasks in idle Unity editor), and that very background functionality is what causes these crashes.

    After I deleted Bakery files and folders, and all objects in my scene, I started getting errors about some objects in my scene referencing missing "!ftraceLightmaps" script (despite my scene being completely empty). That's how I found out that Bakery is injecting some invisible objects into scene. All my subsequent test runs of clean projects without Bakery, or of the same old projects but with clean scenes where Bakery didn't inject anything, never experienced any crashes (thus far).

    Since I don't know how exactly Bakery works and what kind of background functionality it has in editor, it's difficult for me to further investigate this issue and outline exact conditions for replicating the crashes.

    I posted more details and full crash logs here:
    https://forum.unity.com/threads/random-unity-crashes-after-upgrade-to-rtx-3070.1004528/

    I think in coming months a lot more developers will be migrating to RTX 30XX cards, so I hope the author of the asset can address this problem in a timely manner. Not only it prevents any kind of productive work in Unity editor which randomly crashes every few minutes/hours, but it also results in immediately losing of everything you didn't have saved in other open modeling/editing programs (e.g. Blender) due to them being killed during each crash.
     
  47. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    208
    Please check my report in the post right above. There seem to be serious compatibility issues with the new RTX 3070 cards.
     
  48. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Yeah I saw your post and I didn't want to say anything because a lot of people have been saying lately they having issues with them but the overall reviews are good for Bakery. In any case I am not really having any issues with the built in GPU light-mapper and Unity released a new setting to stop light leaking and stuff so for now I will wait on the fence until the future thanks for your help.
     
  49. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    Hi, is it possible to exclude an object from getting a shadowmask while still having a lightmap?
     
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937