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

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    guycalledfrank likes this.
  2. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Another fix for the legacy lightprobe renderer:
    It's not disabling skinnedmeshes even if they are not static objects. It's annoying because players and enemies don't get disabled before rendering lightprobes and they render them black.
    Changing lines 3755 and 3756 in ftRenderLightmap.cs correctly disables not static skinnedmeshes before rendering lightprobes:
    Code (CSharp):
    1.                 //var mf = obj.GetComponent<MeshFilter>();
    2.                 if (mr == null) continue; // must have visible mesh
    (latest bakery update from github)
     
    guycalledfrank likes this.
  3. CenturyLin

    CenturyLin

    Joined:
    Jul 14, 2019
    Posts:
    3
    texture compression may not be the main reason, Follow your advise, i set texture per unit to 20. The red noise in lightmap at the edge is also visible, though reduce influence of noise in scene. it also bring problems, than game package become large(we have so many scene) and to much memory footprint of game。 what if i reset the GI sample value maximun to 256 by modify the code?(what i can do is trust my graphics card)
    upload_2021-3-14_21-45-18.png
    upload_2021-3-14_21-49-12.png
     
  4. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    41
    I had installed the latest version of Bakery from github to work with DX12 but do have a major issue with it - Running out of memory. Not too sure what causes it, but had to downgrade Bakery and use it with DX11. I don't know if this is only and issue with my machine.
     
  5. NicolasDuboc

    NicolasDuboc

    Joined:
    May 19, 2017
    Posts:
    33
    Hey there !

    I'm using Bakery for a while now (love the asset !). I'm using Amplify Shader to write my shaders.
    I'm using the Built-in pipeline, unity 2020.1.12

    I would like to use the Dominant Direction mode with my shaders, to keep specular and metallic information. I read in this thread that it should be possible and that you've already helped some dev to implement it but I didn't find more information. I'm not very proficient with written shader code, so I was wondering if you could help me with that matter ?
     
    guycalledfrank likes this.
  6. INGTONY

    INGTONY

    Joined:
    Oct 13, 2014
    Posts:
    24
    Hi , love bakery i have been using it about 3 years , this time im using it in a vr proyect on android , i know abot the compresion and limitation on the platform, i quite manage the pixelated lightmaps that looks like shadow cascades but as far that i tried is still got a bit of pixaled textures i some parts , also tried an insame amount of texels but still the pixelated texture, , i tried to dig in coding but still not have the perfect result any new advice about this?
     
  7. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Yes, use ASTC compression on the Build Settings instead of ETC.
    Set lightmap quality to either High Quality or Low Quality in the Player Settings, NOT normal quality aince it uses RGBM and it looks awful comoressed.
    High Quality will use ASTC HDR compression mode, which weights nearly as much as the non HDR variant but old android devices can't handle it.
    Low Quality uses regular 8bit per channel ASTC, which uses dLDR encoding and is more compatible but less cool.
    Look at the lightmaps technical info on the manual:
    https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html
     
    guycalledfrank likes this.
  8. INGTONY

    INGTONY

    Joined:
    Oct 13, 2014
    Posts:
    24
    thanks atomicjoe, i got some pretty good results some testing and digging a litle bit more found some great improvemets , its look pretty good in the VR OC quest 2 ,
    basic info for this to work really good ( be aware that is my especific case of use may not work in other scenes)
    1.Experimental settings
    2. directiuonal mode SH
    3 in player settings highquality lighmaps ( works beetter for me , but in low quality i got some decent results)
    4. Texels in my case i tried a lot but i get an amazing smooth result using as high as 250 i know is a bit over kill but it looks really good ,, but to be honest with 50 to 80 is descent lower than that in my case gets unusable
    5. global ilumination samples 64 samples 5 i notice that going any further in samples make any diference in my case,
    6. emissive boost 1 , inderect boost 5 GI 0 works in my case
    7. AO intensity 1.5 radius 1.2 samples 64
    8. rtx ON
    9 Denoise ON , seam denoise ON ( actually all options on) using open image denoise

    im baking with 2080 super laptop Asus GX550 took 12 min but it gets an amazing result worth the time
    thanks again
     
    guycalledfrank and atomicjoe like this.
  9. juanelo

    juanelo

    Joined:
    Jan 28, 2011
    Posts:
    46
    Hi, I was also trying to bake standard Unity lightprobes, and was running into the same issues as hungrybelome reported on the previous page. I updated to the github version and seem to be able to bake. It gave me a warning about lightprobes needing to be baked using unity progressive. Compared to GPU, it took so long I thought Unity had frozen. I wanted to check whether it's possible to to use Progressive GPU to bake the occlusion probes, as opposed to Progressive Default. Thanks!
     
  10. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Yes, the 16x16 shadow map is generated for every scene I use bakery on in my game. Maybe because my default Unity lightmap settings is set to shadow map also, when the lightprobes are being generated? Anyways, making sure to delete that 16x16 shadow map before leaving the scene solves all of my problems! Bakery is working great for my project.
     
    guycalledfrank likes this.
  11. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Hi there ! Hi @guycalledfrank
    I have a serious issue with baking terrain, as the self shadowing doesnt work correctly.
    I already tried a few different settings, like shadow sample count, two sided shadows, adjust sample positions, etc. . The only test that has not run through yet is disabling RTX Mode and using the terrain optimization, because this seems to take forever and given that this test scene is really small (and terrain lightmap resolution rather low) i fear in a real world scenario the baking time would just be unusable.
    I have a RTX 2070 Super, Ryzen 5950x and 92gb of ram, so not a slow system and i have checked that VRAM is not overutilized (when using non rtx + terrain optimization it hovers around 6.8gb/8.0gb). I tried in Unity 2020.2 with URP 10 and in Unity 2019.3 with builtin renderer. Also tried the latest update from git as well as the last stable release of bakery.
    What can i do about this? The documentation about is rather small regarding terrains.
    Why is terrain taking sooo much longer to bake then normal meshes ?
     

    Attached Files:

  12. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Just tried a Terrain Mesh imported from Blender, which is bigger by a factor of 4 and uses higher lightmap resolution. Baked quickly and shadows look pretty much flawless. I really need to be able to sculpt the terrain in the engine though, so this doesnt solve my problem. Just goes to show how bad performance and results on terrain really is bakery. I really wish that there's something that can be done about it. Live without bakery is not worth living ^^
    Screenshot 2021-03-16 163641.png

    Disabling RTX mode also yields broken self shadows on the terrain, but bakes pretty quick. Setting Terrain Optimization to on as well, increases baking time into infinity it seems. The video card is utilized fully, so it does do work for sure but after 15 minutes it's still at "Rendering GI bounce 0 ...". I guess there's something wrong with this option as well as terrain lightmapping in general.
     
    Last edited: Mar 16, 2021
    homemacai and guycalledfrank like this.
  13. Jerremia

    Jerremia

    Joined:
    Nov 26, 2018
    Posts:
    15
    Thanks for the information, i'll have to dig in deeper than!
     
  14. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Trying to bake with HDRP and trying to make sense of the manual and the link it refers to on how to deal with exposure etc here:
    https://geom.io/bakery/wiki/index.p...ok_black_or_have_bad_quality_in_an_HDRP_scene

    Not sure I'm following. HDRP uses real world lighting values and you expose to compensate. Reading the article above, are you saying lower the exposure and skylight and then bake? Can I then increase lights and exposure after the bake, or have to leave it lower intensities?

    I'm not understanding the workaround workflow explanation I think.
     
    Last edited: Mar 18, 2021
  15. Karter_with_a_K

    Karter_with_a_K

    Joined:
    Oct 13, 2017
    Posts:
    2
    Hello! We're using Bakery alongside HDRP, and we're trying to get Shadowmask bakes to allow shadows created from baked light sources to respond to dynamic game objects (e.g. a door closing and restricting the baked light to one side). Right now, we're having problems getting light sources to bake correctly at all with the Shadowmask render mode; they'll persist as realtime lights after hitting render, so if we disable those lights, everything looks unlit.

    We're using the ShadowMask render mode and the BakeryVolumeGraph shader for dynamic objects with a BakeryVolume covering a large enough of an area that'll hit the dynamic objects and light sources in question. Each light source has both a Unity light component as well as the appropriate Bakery light component—with the latter component set to "Indirect and Shadowmask" baked contribution. While we can get the intended lighting effect with the dynamic objects, the light sources appear to remain as realtime lights even after baking.

    Additionally, when we set dynamic objects to the BakeryVolumeGraph shader, transparent materials have issues blending as they do with the HDRP Lit shader (and other shaders). There's some opaque-coloring added to the transparent materials. I've tried adjusting the alpha channel in the Shader Graph directly, but you can still see this opaque coloring at certain angles in-game. Any idea on what may be causing this as well?
     
  16. Luvrael

    Luvrael

    Joined:
    Sep 9, 2017
    Posts:
    20
    Hi, I have a few problems baking the big scene. The biggest problem is the buildings and the bleeding of decorations inside. On scene, I spread light probes, so I have settings on L1. The pictures show the settings I have in the project and some kind of bleed.

    upload_2021-3-19_13-11-56.png
    upload_2021-3-19_13-12-9.png

    Settings:
    upload_2021-3-19_13-12-28.png

    The pictures where you see bleed are without area lights. With them, the building is better lit as I want, but the building and decoration have more artifacts. Ultimately, I would like to use this type of lighting to brighten up buildings.
    I used a baker's skylight.
    Each model has the "Lightmap UV Settings" option turned on.

    Do you have any idea what I can improve in the settings or what I was missing in the baking process? I would like to use your assets in the game, but I don't know how to bake buildings and their interiors nicely.
     
  17. yurikrsk24

    yurikrsk24

    Joined:
    May 12, 2019
    Posts:
    2
    Hi guys, can you tell me the optimal settings for baking?

    Conditions:
    500k+ low-poly trees (300 vertex)
    Multi-terrain - 12 sections
    Sections of 4x4km each

    NASA computer available)
     
  18. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    Seems like some problem with the API updater. May be related to broken Unity hub version, see: https://geom.io/bakery/wiki/index.p...2.80.9D_and_.E2.80.9CUnityUpgradable.E2.80.9D

    Possibly related? ("Still happens in 2018.2.6") https://issuetracker.unity3d.com/is...embly-index-4-is-thrown-when-updating-scripts

    If you're unable to fix the API updater, you can (as a last resort) just replace the things the error message tells you about (replace all "Radiosity" with "Enlighten", etc).

    Thanks, makes sense. The filtering code was copied from the other "find everything worth lightmapping" part, but in this case we don't really care about objects without the mesh filter. Fixed.

    My bet is on the denoiser then. Tried a different one (OpenImageDenoise?)?

    RAM or VRAM? What message do you see?
    Also why downgrade Bakery? If you switch the project to DX11 mode, the newest version will also work in DX11.

    I guess you can try porting my non-Amplify graphs to Amplify? See BakeryURPDirSpec.shadergraph included in the package (latest version). The key part is embedded in a custom code node though. It's a single function. AFAIK Amplify should be able to call a function from regular shader code? (BakeryDecodeLightmap.hlsl -> DirectionalSpecular_float)

    If you can use SH lightmaps instead of dominant direction, you can take a look at NOT_Lonely's Amplify graphs: https://geom.io/bakery/wiki/index.php?title=Community_extensions#Amplify_shaders

    Totally possible, although PGPU has a history of being unstable (I had it crashing the editor right after clicking "generate lighting"...), so I'm not sure it should be the default.
    In ftRenderLightmap.cs you can replace "LightmapEditorSettings.Lightmapper.ProgressiveCPU" with "LightmapEditorSettings.Lightmapper.ProgressiveGPU", it will do the trick.

    Woah.
    If you have RTPreview, I wonder how does it look there? Can be there something weird with the "terrain hole" texture?
    Not sure why it can happen, If you can send me a unitypackage with this terrain, I'll debug it! I have a bunch of terrain scenes, but I can't reproduce it there.

    Yes.

    Not really.

    I explained it a bit in this twitter thread: https://twitter.com/guycalledfrank/status/1358038418035531778
    The key thing: absolute values are not as important as the ratio between them.
    Bakery is not optimized to use very big numbers. Using smaller values while keeping the ratio won't make it less "physical", it's just a change of units (like using meters instead of millimetres).
    I'm aware that this kind of workflow is clumsy though. I'll add some global pre-scale option (similar to HDRP Preexposure) so you will be able to use HDRP's intended values.

    Make sure Shadowmask is enabled in HDRP settings (it was disabled by default in some versions). Make sure to also use full shadowmask (not "distance shadowmask"). Maybe try it with the default lightmapper first.

    Hmmm... any screenshots? Maybe some part of the object is just very bright, so it doesn't fade as easily?
    If it's the specular, you can also try multiplying emission by your opacity value, I wonder if it'll help.

    It's hard to see what's going on on these screenshots. Perhaps the first thing I'd try is to increase Scale In Lightmap on the problematic objects. I'm not sure how exactly the lights are positioned here. Does it happen on a small part of this scene, when isolated? If you can send me some smaller unitypackage which showcases the problem, I'll happily debug it.

    It also depends on player's perspective. Flight sim? First person? All area is explorable, or only some of it?
    500k trees * 300 = 150 mil verts. I'd avoid baking this as is, can overflow the vertex buffer and generally won't be fast.
    So maybe like this:
    - Bake some Skylight into tree textures/vertices (as a part of tree material/mesh, shared on all instances)
    - Make trees non-lightmapped.
    - Create some VERY primitive LOD for the tree (1-2 quads). Mark it lightmapped. Set their Scale In Lightmap to 0, so they don't get lighting themselves.
    - Enable Terrain Optimization.
    - Bake.
     
    NicolasDuboc and yurikrsk24 like this.
  19. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    That would be absoletely awesome if you could add this! It's just that we're already use to using realworld lighting values, coming from a traditional non-realtime, traditional offline rendering background.
     
    atomicjoe and guycalledfrank like this.
  20. Jerremia

    Jerremia

    Joined:
    Nov 26, 2018
    Posts:
    15
    Getting an error when importing Bakery into 2018.4.22;
    copying temp/export
    package76193886c209e4d439a7944f60c81d9d/c17aba6c3878ffb4da8ecb9800b93d9e/asset to Assets/editor/x64/bakery/d3dcompiler_47.dll: acces denied.
     
  21. CmartinezSaltoki

    CmartinezSaltoki

    Joined:
    May 21, 2020
    Posts:
    10
    Hi again Frank!
    It seems the patch you uploaded to github doesn't fix the reimport issue cause some of my team mates still found models which needed to be reimported manually to visualize them correctly. They weren't able to start new bakes either so we're going back to 1.8 version.

    Thanks for your attention anyway. We'll keep an eye out in case you find a new solution.
     
  22. CrispyCritter

    CrispyCritter

    Joined:
    May 11, 2018
    Posts:
    19
    Did you mange to test this? i have had no luck yet but i think i am doing some thing wrong :(
     
  23. NicolasDuboc

    NicolasDuboc

    Joined:
    May 19, 2017
    Posts:
    33
    Thanks for your reply, I'll try that, Amplify can use custom code, so I should be able to replicate it ! I'll let you know how it goes. I'm aware of the SH amplify shaders, but I'll try to make them work with Dominant Direction as it fits the project better. :)
     
    guycalledfrank likes this.
  24. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937

    Hi. I was away some time and have to reintegrate Bakery to 2020.3.0 LTS projects.
    Is there some improvement or changes in using same light intensitys and exposures like the settings from the Unity Standard HDRP scene (attached post) or is there still the need to bring them down for bakery to have good bakery bakes?

    I am also interested in any Bakery HDRP improvements after the November release.
     
  25. dholland

    dholland

    Joined:
    Mar 23, 2017
    Posts:
    5
    Using version 1.8 of Bakery on Unity 2020.2.7f1. I am getting this error all of a sudden...was working fine for weeks and then this error started today and will not go away. I restarted, changed settings, reimported bakery. I have no clue why this is happening all of a sudden. PLEASE HELP!

    Exception caught: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <eae584ce26bc40229c1b1aa476bfa589>:0
    at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
    at ftBuildGraphics+<ExportScene>d__203.MoveNext () [0x00d8c] in C:\Users\danielh\Documents\projects\Beaverfit\Unity\beaverfit_v0.1\BeaverFit\Assets\Editor\x64\Bakery\scripts\ftBuildGraphics.cs:5106
    UnityEngine.Debug:LogError (object)
    ftBuildGraphics/<ExportScene>d__203:MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:5956)
    ftRenderLightmap/<RenderLightmapFunc>d__263:MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4843)
    ftRenderLightmap:RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4247)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()



    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    ftBuildGraphics+<ExportScene>d__203.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftBuildGraphics.cs:5957)
    ftRenderLightmap+<RenderLightmapFunc>d__263.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4843)
    ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4247)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <b76552deb4624e46abeeb45b48b7f62d>:0)
     
  26. dholland

    dholland

    Joined:
    Mar 23, 2017
    Posts:
    5
    What is this error and how can I fix?

    Error (-1): Unknown error (Details: Function "_rtContextLaunch2D" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoHAsync( dstHost, srcDevice, byteCount, hStream.get() ) returned (702): Launch timeout)
     
  27. CrispyCritter

    CrispyCritter

    Joined:
    May 11, 2018
    Posts:
    19
    Hi, is there an email or some thing i can contact the developer for support?
     
  28. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    you can send @guycalledfrank a private message or go to the discord server for help. He is active in this forum though, but usually the weekends.
     
    guycalledfrank likes this.
  29. dholland

    dholland

    Joined:
    Mar 23, 2017
    Posts:
    5
    Seems like when I cancelled a bake Bakery left some temp gameobjects in the project that was throwing the errors. That fixed the first errors. The Cuda memory error was fixed after a fresh reboot of my system.

    Now I am having a new issue...previously my terrain trees shadows were baking fine. Now the shadows aren't baking...any ideas why?
     
  30. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    -EDIT: Ok, no, the problem is not with bakery but with ASTC_HDR compression. Bakery Works fine! -
    original post:

    Very bad news for Android and Bakery:
    Having a scene baked with Bakery in Unity 2020.3.1f1 LTS makes it hang and never load on an Android build.
    Sometimes the scene will not load, others it loads but it doesn't render anything to the screen (sound works).
    I have tested this for hours and the only thing that fixes all the issues is completely removing any trace of Bakery from the scene using the Utilities->Clear Baked Data->All Data and Bake Settings
    It's clearly an issue with Bakery's scripts and hidden objects.
    Unity 2020.3 LTS is the new Long Term Support version, aka "the version of Unity you want to use", so it's actually a pretty big deal.
    Bakery worked fine on Android with Unity 2019 LTS

    Windows 10 pro 64bits, building for Nvidia Shield TV 2019, Vulkan, Standard Pipeline, Forward Renderer.
     
    Last edited: Mar 24, 2021
    guycalledfrank likes this.
  31. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    false alarm! Bakery works just fine with Unity 2020.3 LTS! The problem I was having was with ASTC_HDR5x5 that Unity2020.3 doesn't like AT ALL: If you override the texture compression with this format, the build hangs, but when unity uses this format automatically, it works fine. The mysteries of Unity...
     
    guycalledfrank likes this.
  32. dholland

    dholland

    Joined:
    Mar 23, 2017
    Posts:
    5
    Not sure why, but everything is working as expected now (seems computer needed a reboot...thinking maybe my GPU was throttling down for some reason. The errors can be frustrating, but when Bakery works it is far better than Unity's lightmapping.
     
    guycalledfrank likes this.
  33. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Once you try Bakery, you can never go back to Unity's lightmapper.
    Actually, the lightmapper in Unity is going backwards: the lightmapper in Unity 4 was better than what we got with Unity 5 and Enlighten, but Enlighten could make realtime GI so it was great. Now that they plan to deprecate Enlighten, we will no longer have realtime GI and the lightmapping itself is worse than on Unity 4.
    Thanks the techno-gods we have Bakery!
    All hail that guy named Frank! :D
     
    guycalledfrank and dholland like this.
  34. madruytb

    madruytb

    Joined:
    May 10, 2018
    Posts:
    26
    Hey frank, is it possible to change a scene lightmaps before loading? for instance I have a scene where I want to load either at day, night or sunset (I know that Runtime switchable/blendable lightmaps is quoted as coming soon feature, but in my case it would not be required to be exactly at runtime, files could be replaced before loading this scene, if that changes anything.)
     
    atomicjoe likes this.
  35. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I would need this feature too plus changing the lightprobes along the lightmaps on loading a scene (not blending or anything fancy just a way to select which lightmaps and lightprobes will be used when the scene loads)
     
  36. JetNikus

    JetNikus

    Joined:
    Jun 2, 2016
    Posts:
    3
    Hello! Is it possible to remove the plugin from project but keep baked lightmaps?
     
  37. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    guycalledfrank and JetNikus like this.
  38. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Hi, How can we bake Mixed light with Bakery? I want to use real-time shadows for dynamic objects like Player and baked shadows for other static objects.
     
  39. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,666
    OK, I took a look into better HDRP support today. First, there was simply a high intensity clamp (>= 1024) during texture conversion to .hdr which I added because Unity texture importer seemed to make very bright spots to look weird. Anyway, it's not a problem in modern versions and in HDRP, so I removed it.
    I also reconfigured OptiX 7 denoiser to work in proper HDR mode instead of my original tonemap->denoise->inverse_tonemap solution which was the only option in the time of OptiX 5. This makes OptiX 7 the best looking denoiser for HDRP with its typical high values.

    So I think it kinda works now without any intensity fiddling? Here is the default HDRP sample scene, original intensities, latest github patch, OptiX 7:

    upload_2021-3-27_22-9-32.png

    upload_2021-3-27_22-9-36.png

    (Some objects look a bit off as they are dynamic and lit by per-object interpolated probes)

    Please give it a try :) Make sure to update from both bakery-csharp and bakery-compiled.

    I wonder if you'll be able to hit a half-float precision limit anywhere (washed out/clamped colors). If you will... I can try adding some "pre-exposure" to the lightmapper.

    Try closing Unity and reimporting again. Or maybe do you have d3dcompiler_47.dll already present in the project as a part of some other plugin? You can uncheck it from Bakery package.

    Weird! Is there something different in their workflow? Can you maybe describe it in more detail?
    Also why can't they start new bakes, what happens if they try?...

    I didn't. I know other people were using bundles though. Maybe someone can share their experiences with you in Discord?

    1) In case you somehow ended up having an object named __ExportTerrain in the scene, delete it.
    2) In any other case, please try applying latest github patches.

    https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_a_.22Launch_timeout.22_error

    Yeah, you should be able to see it here: https://assetstore.unity.com/publishers/37453
    And I'm also here on the forum, just not every day (but at least once a week :D)

    Yeah I really hope you guys are not too stressed waiting for the weekends... it's just hard for me to switch focus between development and support. If I try to interleave them very often, I'm not very productive. On weekends I usually take full (1-2) days for support (including debugging various test projects).

    Are you sure "export terrain trees" checkbox is enabled?

    Hmm... I think the easiest way here might be to just hack my ftLightmapsStorage.cs script.
    The script is executed as the scene is loaded, and it applies the lightmaps to everything. ftLightmapsStorage has a bunch of arrays for different types of lightmaps (maps, masks, dirMaps, rnmMaps0/1/2).
    What you can try is:
    - Bake each type of lightmaps. You can change Output Path before bakes, so you'll end up with identically named lightmaps with identical UVs, just in different folders.
    - Empty my arrays so the scene no longer references any specific lightmaps.
    - Add your lightmap loading code to ftLightmapsStorage::Awake(). It should somehow load the desired map assets and put them back to the arrays.

    I guess you can just dump LightProbes.bakedProbes values somewhere and put them back from different arrays on load. Unfortunately you can't change occlusion probe (per-probe shadowing for mixed lights) data (neither can I, there is no API for it).

    Yes, you totally can.
     
    Last edited: Mar 27, 2021
    keeponshading and newguy123 like this.
  40. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Yes I know but how? Is there any reference in documentation?
     
  41. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    guycalledfrank and umair21 like this.
  42. Falondrian

    Falondrian

    Joined:
    Nov 1, 2017
    Posts:
    73
    Hello @guycalledfrank ,

    new customer here, really like the asset couple questions

    - URP supports now shadow masks, are you planning to update the shaders?
    - I generate a building based on prefabs at runtime, so I cannot prebake light traveling between the prefabs. Would you have a starting point for me to blend the lightmaps and volumes between two runtime-connected prefabs in order to avoid seams like they did on Blades? https://de.slideshare.net/unity3d/d...ural-game-the-elder-scrolls-blades-unite-2019
     
    Last edited: Apr 1, 2021
    guycalledfrank likes this.
  43. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Mauri likes this.
  44. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Hola, how is Bakery Texels per unit meant to work along Mesh Renderer Scale in Lightmap ?
    Obviously it isn't a straight multiplier as i would expect.

    10 texels per unit, 1 Scale in Lightmap != 1 texels per unit, 10 Scale in Lightmap.
    Thanks !

    Would you recommend to set Texels per Unit to the maximum resolution wanted and use Scale in Lightmap with values <= 1 ?
     
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    That's what I do: set the texels per unit as the general resolution I want and then set the scale lower for unimportant things or set it higher for little things that will be seen from up close.
     
  46. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Yes i don't know, the fact that the scale in lightmap isnt a multiplier is counterintuitive. I guess that's because Bakery tries to optimize the number of lightmaps and scale in lightmap is relative to an objetct own lightmap ? Doesn't seem to be the default Unity Lightmap Resolution /Scale in lightmap behavior
     
  47. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi,

    In Unity 2020.3.0f1 HDRP 10.4.0 i get for
    BakerySHGraph
    and
    BakeryRNMGraph

    i get a

    Code (CSharp):
    1. Shader error in 'Shader Graphs/BakeryRNMGraph': 'SAMPLE_TEXTURE2D': Too few arguments to a macro call. at Assets/Bakery/shader/ShaderGraph/HDRP/BakeryDecodeLightmap.hlsl(133)

    BakeryDirectional.JPG

    is there some fix available?

    I also imported the latest package from
    https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper

    Unbenannt.JPG
     
    Last edited: Mar 30, 2021
  48. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi,

    would it be possible to add the hdr sky to the rt preview.
    This would be very helpful to get an better more consistent impression of the light setup.

    The HDRI Sky is not visible (black) in the Bakery RT Preview (Window Mode)
    preview.JPG

    or when you activate Render in Scene View in the Bakery Preview the HDRI Sky disapears.

    preview_in.JPG

    My HDRI Sky and Visual Environment is setup like this. (Screenshot right)
     
    Last edited: Mar 30, 2021
    guycalledfrank likes this.
  49. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937

    Thanks.
    Her my step by step test for others to reproduce.
    Target is to use same values for Directional Light and HDR Sky and Bakery Directional Light and Bakery Skylight in new HDPR Standard Template scene.

    1)
    Create HDRP Template in
    Unity 2020.3.2 LTS HDR 10.4.0

    Save new scene. Hit rebake to to a reference bake with Unitys PLM.
    This is the result and Standard bake settings.

    1.JPG


    Switche to Bake Lightmap preview.
    You have to go to Lighting exposure -11.3 to get an preview in the scene window.

    2.JPG


    Now add Bakery Direct Light to the Directional Light Sun.

    3.JPG

    Hit matched Lightmapped to realtime.
    Strengt gets converted to 31830,99
    Configure Bakery comparable to PLM settings

    Render Mode indirect, Dominant Direction, L1 Probes, 40 Texel per Unit, Optix 7, RTX mode, use scene named output path


    4.JPG


    Hit bake and wait 2.00 min.
     

    Attached Files:

    • 5.JPG
      5.JPG
      File size:
      516.5 KB
      Views:
      291
    Last edited: Mar 30, 2021
    guycalledfrank likes this.
  50. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    I think you fix works for Directional Light intensitys.

    You have to go to Lighting exposure -11.3 to get an preview in the scene window.
    Overall same intensity like before on PLM.

    6.JPG


    Add Bakery Skylight.

    7.JPG

    Hit Match to scene Skybox.

    Color is adjusted to grey.
    Intensity jumps to 4.59.
    Sky texture is not set.

    This is probably al little missleading because some stuff is set but this are not the values from the HDRP Sky or texture. Probably i am wrong.

    What would be the best here to match the intensitys from HDRP?

    The HDRP Sky in the scene is set to Exposure 13.5.

    68.JPG

    Bakery Sky Light Intensity has 4.59.

    Do you know how to exactly match between HDRP Sky Exposure or Multiplier and Bakery Sky Light Intensity and Indirect intensity.?

    9.JPG


    Here is a overview about

    Lighting exposure set to -9.1
    and
    Bakery preview Exposure set to 0.0028 to get something.

    10.JPG

    Probably i did something wrong.
    But i found now way to get an usable Bakery preview with these values.
    Think the problem could be the high Directional Light value from 31830,99 for the Bakery. preview. I have to lower it again to around 10 to get some preview.

    All in all.
    Probably you have some tips how to set Bakery Directional Light and the Bakery Skylight so that the RT preview is working in this Standard HDRP Template with the given PostProcess and Exposure settings?
     
    Last edited: Mar 30, 2021