Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

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

  1. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    to MR F.
    I found some issues with RT preview.
    I use the latest Bakery patch in Unity2020.3.20f1.

    The Bakery preview with HDR off (1. Screesnhot) and on (2. Screenshot)with Render in Scene View enabled still needs an 0.0001 value to make some preview possible.
    I see no also no difference between booth modes.

    Would it be possible to get an real value here to have an preview based on "real" values.
    How could i calculate the ~0.0001 needed here from my EV setup?

    Unitys Scene Exposure in settings from scene view camera ranges from
    -11 to 16. These would be nice.

    The IBL is not shown here. You have an grey background.

    25.JPG

    25.JPG

    If RT preview rendered in extra window there is an IBL displayed but with an wrong exposure. ( compare left vs middle on screenshot)
    Here you need also an around 0.0001? value to make some preview possible.

    27.JPG

    I know this is hard stuff.
    But RT preview would be an even greater killer app if could see correct exposured IBL and correct exposured lightmap preview in HDRP.
     

    Attached Files:

    • 26.JPG
      26.JPG
      File size:
      77.1 KB
      Views:
      245
    Last edited: Mar 20, 2022
  2. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    128
    Thank you for the example!
    I know how cameras and shutter speeds/iso work, but I didn't use the "physical" component on my camera, only used the Directional Lights Intensity in Lux and the Exposure in the PostProcess. My Photography knowledge didn't help much here.

    But you are right, I should think about it more like real lights.
    I didn't like the "black vs white" contrast from outside daylight to bounced light in my interior (Though, automatic Exposure worked in both). Instead of increasing the indirect light, I now simply lowered the Direction Lights intensity and adapted the Post Process exposure, so it's still bright outside, but the contrast (dynamic range) to inside is lowered. Looks better now.
     
    keeponshading likes this.
  3. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    128
    Update on my Exterior/Interior Problem:



    I am pleased now. I still had an issue with my Shader (accidentally plugged the blue channel of the MaskMap into the AmbienOcclusion slot. This caused the material not to show baked lights. Compared to default HDRP/Lit and investigated. Corrected my mistake and now it looks nice in shaded mode, too.)
     
    guycalledfrank and keeponshading like this.
  4. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    Nice.

    Here is an HDRP Lit Shadergraph.
    2021.2 (updated with Keywords and SurfaceGradients)
    https://github.com/RemyUnity/SG-HDRP-Lit/tree/2021.2
    2020.x
    https://github.com/RemyUnity/SG-HDRP-Lit/tree/master


    You can add the Bakery SH Graph from Latest HDRP Graphs
    https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper

    and jump from here



    30.JPG
    RTX OFF.)

    to here. Adds some specular.

    31.JPG
    RTX, also OFF.))

    good read linked in Bakery documentation:

    https://media.contentapi.ea.com/con...-precomputedgiobalilluminationinfrostbite.pdf
     
    Last edited: Mar 21, 2022
    guycalledfrank likes this.
  5. pwrdengine

    pwrdengine

    Joined:
    Aug 24, 2021
    Posts:
    1
    i found some object are not correct baked into lightmap,especially shadowmask ,some object get black
     
  6. DigitalJackson

    DigitalJackson

    Joined:
    Mar 5, 2015
    Posts:
    3
    Bakery Real-Time Preview - When using "Render in Scene View" option, is there a way to get this working in 2D scene view?

    2D view emulates our game view, but when I use the real-time previewer in this view the preview render looks to be using a perspective view rendered onto the 2D view (if that makes sense).

    I found no other questions asking about this and realize it's not something most devs would need or want. Just checking to make sure there's not a way to have this work as currently implemented.
     
    guycalledfrank likes this.
  7. Gujju

    Gujju

    Joined:
    Mar 25, 2016
    Posts:
    1
    Hello,

    I have been trying to figure out a solution for the fireflies that I am experiencing on the scenes. I did take a look at the FAQ and none of those helped solve the issue.

    I am using Full Lighting mode with 1 directional light(Direct Light) and one skylight. the settings for the lights and bakery are attached below. I have tried every possible combination with reducing the intensity, reducing bounces, increasing samples and none of them have fixed the issue.

    Regarding the direct light, as we are working on a webgl game, we cannot use post process and we need the sun light bake to be atleast 2 Intensity to get the sun bake we would like, If the fireflies force us to use a reduced intensity, can you share any ideas on how can we achieve similar intensity lightbake of 2 without the fireflies effect?

    Thanks
    Swayam
     

    Attached Files:

  8. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Thanks! I think I've just fixed it. Please try updating via the patcher.

    Thank you. I had a different, more detailed visual story for that demo, but just couldn't finish it in time. It was something about diving deep into something hidden, ancient and uncomfortable and saving someone from that depth, bringing them back up.

    Actually yes:

    upload_2022-3-21_23-9-55.png


    Awesome!

    Yes, "global" is engine-global. Technically it just uses Shader.SetGlobal* function, e.g. https://docs.unity3d.com/ScriptReference/Shader.SetGlobalTexture.html

    Anything else needs volume data to be set either per-material or per-MaterialPropertyBlock (like in example_volumes_advanced).

    In my game, with a custom render pipeline, I'm avoiding it by actually splitting my draw calls into different groups with different SetGlobal calls inbetween...
    In a less elegant way it can be hacked by having multiple camera copies using a different Layer Mask for each scene and doing SetGlobals before rendering (but it's not the most reasonable option).

    Related: https://geom.io/bakery/wiki/index.php?title=Troubleshooting#I_get_a_.22Can.27t_load.22_error

    Default path is: Assets/Editor/x64/Bakery/.ftracelog.txt
    It's not visible in the Unity asset browser.

    Not sure how these are connected... maybe I'll see better clues in the log.

    But I suspect that the "Can't load" error is not the first. There is likely something else before that (going out of memory trying to render the light?), and it's just a consequence.
    But 512 far samples isn't too much. I used thousands.

    I tried this script:


    using UnityEngine;
    using UnityEditor;

    public class ftTest
    {
    [MenuItem("Bakery/Test", false, 41)]
    private static void SaveSettings()
    {
    var storage = ftRenderLightmap.FindRenderSettingsStorage();
    storage.renderSettingsOutPath = "Assets/Lightmaps";

    var bakery = ftRenderLightmap.instance != null
    ? ftRenderLightmap.instance
    : new ftRenderLightmap();
    bakery.LoadRenderSett)ings();

    bakery.RenderButton();
    }
    }


    And it worked correctly :confused:
    Even when the folder does not exist prior to baking.
    Make sure that "Use scene-named output path" is off (storage.renderSettingsUseScenePath == false).

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

    Will continue tomorrow...
     
    WildStyle69 and keeponshading like this.
  9. hiyougami

    hiyougami

    Joined:
    Jan 27, 2017
    Posts:
    4
    It works! Thanks so so much!
     
    keeponshading and guycalledfrank like this.
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    I've just pushed a little update to ftServer, you can get it via the patcher. You can now run the server with this command line:

    ftServer tempFolder -p 31337


    Where 31337 is the port you want.

    On the Unity side, just change the value of serverPort variable in ftClient.cs.

    Well this one is hard to avoid. Sounds like it kills the connection when locked. Maybe there are some Windows settings to keep everything running properly when locked (?)

    I don't have this option, but perhaps you should try using Legacy light probe mode? It simply renders the scene from the camera for each probe; thus instead of the Bakery-calculated skylight, it will use the skybox that you see in the Editor. If the skybox is dark, it'll be dark.

    Can you check if it works with the latest patch? (their problem is fixed now)

    Good question. I think Unity's own HDRP example projects hold some answers, or maybe you can just google color temperature/intensity of the Sun at the given time of day? Patched Bakery can convert/match HDRP's color temperature values to a regular color/intensity pair.

    Won't work. The skybox->skylight matching only works in the standard RP (and with standard skybox shaders). In your case just leave the color to white, intensity to 1 and plug the generated sky probe texture.

    Updated a bit to avoid future confusion: https://geom.io/bakery/wiki/index.p..._use_Skylight_with_a_procedural_sky_shader.3F

    Nice. Baked objects look close to IBL.

    When using "Update skybox probe", all units are baked into the resulting texture, so perhaps you don't need it, just keep color/intensity neutral (white/1).

    Woah... and is it without the denoiser? Possibly some half-float overflows. Typical HDRP values are already very intense and using indirect intensity pushes the limit. Maybe you should keep the physical workflow in HDRP (avoiding indirect boosting, maybe boost it with post instead).
    Or try using lower intensity values, setting up a more standard-pipeline-like conditions (like in my example scenes https://geom.io/bakery/wiki/index.php?title=Manual#Notes_on_HDRP.2FURP )
    Using physical units doesn't make things more "realistic". I wrote a little thread about it: https://twitter.com/guycalledfrank/status/1358038418035531778

    Maybe you can have 2 different directionals separated by bitmask?
    RTPreview should take indirect intensity into account, but it has somewhat higher precision because of the different rendering approach
     
    Last edited: Mar 22, 2022
    keeponshading likes this.
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Yeah, HDR mode currently only works in the standard RP. HDRP cannot apply its postprocessing over it for some reason :(
     
    keeponshading likes this.
  12. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Oh, that looks neat!
     
  13. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Do you have more details? Screenshots of the results and of your settings?

    RTPreview currently assumes a perspective camera. The path-tracing code assumes a pyramid of rays. Sounds like I should add some additional ortho mode...
    As a quick temporary workaround, you can try using just a very narrow FOV in scene view and placing the camera far away.

    These are not fireflies, they're just texture compression artifacts.
    Some things you can check:

    Compression settings:
    https://geom.io/bakery/wiki/index.p...id_project.2C_and_lightmaps_don.27t_look_good

    Something about reducing denoiser artifacts, but it can also give more compression-friendly results as well:
    https://geom.io/bakery/wiki/index.p...oduces_bright_edges_around_geometry.2Fshadows
     
  14. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    67
    Wow you are fast, it fixed everything for me. Thank you!!!
     
    guycalledfrank likes this.
  15. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Thanks for the reply and technical details it's appreciated.

    What are the performance implications for using larger Bakery Volume's vs. multiple smaller? For instance, all my underground scenes are baked together for lighting anyway. So I could have one larger larger Bakery Volume that spans all the scenes. This would be OK even if a particular scene is unloaded sometimes for performance reasons?

    // Wildstyle
     
  16. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Volume component shows you its VRAM usage as you change its dimensions. If you're within your memory budget, it's OK. Using "Compress volumes" option can drastically reduce memory footprint (but it's currently optimized for PC/Console compressed formats only and needs a slightly different shader; Standard RP Bakery shader supports this, but for URP/HDRP I need to write another graph...).
     
    WildStyle69 likes this.
  17. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Cool, good to know - great info as ever, thanks! So I'll look into this in more detail.

    Please let me know if you ever get around to writing the URP shader version that uses the compressed format.

    // Wildstyle
     
    guycalledfrank likes this.
  18. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    217
    Hello again, I am attempting to get some ambient lighting for my dynamic objects in an interior environment but my light probes are ending up half dark. I have tried using Baked (with Direct and indirect contribution) & Mixed (with indirect contribution only) and getting the same results. I am using L1 mode, legacy seemed to give different results but not much better.

    I am using indirect mode and the latest version of Bakery from the in Editor github update tool.

    I am using HDRP with Unity 2021.2.16.

    Has anybody encountered this and overcome it? Would appreciate any help.

    Also wondering if there will be any support for the currently experimental Probe Volume system, more info here: https://forum.unity.com/threads/ada...erimental-release-for-hdrp-in-2021-2.1238824/
     

    Attached Files:

    Last edited: Mar 25, 2022
  19. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    upload_2022-3-25_9-33-0.png upload_2022-3-25_9-34-29.png upload_2022-3-25_9-37-58.png upload_2022-3-25_9-38-14.png

    Hello. We just purchased 1.9 of Bakery to evaluate for our needs and have a few questions.

    1. We are using 2021.2.10f1 with URP. Should we expect any issues?
    2. Is there iOS build support?
    3. This is more of a "please help me". I put a model that we are using into an empty scene with a model we are using. After baking (with Bakery default settings) There are a few issues:

    Looks like light leaking (meshes have 'Generate Lightmap UVs' enabled): upload_2022-3-25_9-33-0.png

    The door needs to move and is not set to static while the rest is marked static, how can I remedy this difference in lighting?

    upload_2022-3-25_9-34-29.png

    Finally the directional light (it is set to 'Mixed mode' it has the Bakery Direct Light script set to 'Indirect and Shadowmask') shadows are very low quality.

    upload_2022-3-25_9-37-58.png

    Here are my URP settings:

    upload_2022-3-25_9-38-14.png
     
    Last edited: Mar 25, 2022
  20. Ologon

    Ologon

    Joined:
    Nov 16, 2014
    Posts:
    16
    Hi,

    I've recently purchased Bakery and when I went to try it, it didn't work,
    telling me both RTX and non-RTX baking fails, and all denoising options don't work.

    I have an RTX 3080 with a Ryzen 5950x and both OptiX and openimagedenoiser work in blender without problems.
    The gpu drivers are up to date and I'm using the latest unity version. (Built-in pipeline)

    Looking at the troubleshooting guide I saw I needed to enable RTX mode (which I already did) and download a patch from github.
    Followed those steps but even after applying the github patch the situation didn't change.

    If I try to bake the lightmap ignoring the errors, I get the error below.

    Help is appreciated!

    EDIT: Problem solved! After more troubleshooting the problem was apparently caused by Avast antivirus blocking bakery. After adding an exception everything started to work.
     

    Attached Files:

    Last edited: Mar 26, 2022
    guycalledfrank likes this.
  21. TriangleJel

    TriangleJel

    Joined:
    Sep 24, 2021
    Posts:
    7
    Hey Frank,

    The lighting intensity that goes together with bakery lights, on what is this based? Lux, kandela,lumen, .. ?

    Cheers!
     
  22. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    An 51 000 Lux HDRP dir light converts to 16233,8 Bakery direct light intensity.
    Why dividided by Pi 3,141593465485. I have no clue.
    An table with all the conversion units from Unity HDRP to Bakery would be nice to have in the docu or faq s.

    edit: found something here

    https://www.compuphase.com/electronics/candela_lumen.htm
     
    Last edited: Mar 27, 2022
  23. DigitalJackson

    DigitalJackson

    Joined:
    Mar 5, 2015
    Posts:
    3
    Thanks, would be great to see added ortho mode... will try suggested narrow FOV in scene view.

    One more issue to mention is that it's helpful for editing our UVs to arrange then in separate UV grids. This works fine using Unity lightmap baking, but with Bakery the resulting lightmaps are not correct once you get so far out from the 0 to 1 UV space. Anything past blue area in image does not generate correct lightmaps. Bakery_UVextents.jpg
     
    guycalledfrank likes this.
  24. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    831
    @guycalledfrank
    I was late to reading your blog, very well said.
    I think you hit the nail on the head with this quote from your blog.
    "The only thing that we learn from history is that we learn nothing from history."
    Keep up the fight for peaceful existence for all. Hope your family and friends stay safe.
     
    guycalledfrank likes this.
  25. elok11

    elok11

    Joined:
    Dec 9, 2019
    Posts:
    18
    Hello,
    In my project I have three different scenes. When I bake the lights in scene A, everything is OK (image 1).
    But when I bake the lights for the scene B, somehow the lights in scene A become corrupted (image 2).
    This happens almost always. Image 3 and 4 are the parameters used.

    Do you have any idea about why is this happening?

    Thank you.
     

    Attached Files:

  26. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Yeah, it's "ringing", and it's an artifact that can happen to L1 light probes with high contrast lighting. "Legacy" light probes are L2 and should give better results in this scenario. Can you show me some screenshots when using Legacy?

    Bakery shaders have a "non-linear" option that fixes the way the light probes are sampled to avoid it: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_shaders

    There is also a BakeryURPNonLinearLightProbe.shadergraph for URP. I don't have a graph for HDRP currently, but I can do it.

    When using Bakery Volumes, this algorithm is always applied.

    I'd wait until it gets less experimental. For now I recommend using Bakery's own volume system: https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Volume

    I didn't test this particular version, but probably not.

    Yes.

    Looks like real-time shadow leaking to me (due to bias). Please check if it still happens if you disable the real-time light.

    Currently your door is lit by a single light probe. You can try my hack to bake the door fully without it casting a shadow on everything else: https://forum.unity.com/threads/bak...tpreview-released.536008/page-17#post-3697591

    These are real-time shadows, not baked.
    Try disabling "distance shadowmask" to prevent Unity from making all nearby shadows real-time.
    Maybe check my example_shadowmask scene, it should be set up correctly.

    For directional lights, "Intensity" is (Lux/Pi).
    For point lights "Intensity" is (Candela/Pi).

    Just updated the docs to include this info.

    And if you're wondering where did that Pi come from: https://seblagarde.wordpress.com/2012/01/08/pi-or-not-to-pi-in-game-lighting-equation/

    Thank you!

    Probably this?
    https://geom.io/bakery/wiki/index.p..._in_one_scene_breaks_its_UVs_in_another_scene
     
    keeponshading and chadfranklin47 like this.
  27. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Are there plans for a Bakery 1.9+ update on the Unity store? My company won't allow us to access the git thing to get these 1.9+ patches.
     
    guycalledfrank likes this.
  28. CapelaGames

    CapelaGames

    Joined:
    Oct 13, 2014
    Posts:
    9
    I have an odd setup for the scene.

    I have a rotating space-station, which would be receive real time lighting. However, I would like to bake internal rooms (inside of the spinning spacestation) with static objects and lights (static in relation to the room). The spacestation itself might get lit by those internal rooms too, which is why I had it set to receive shadows. How might you go about this?
     
  29. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    217
    @guycalledfrank Thanks for your response. I have attached some screenshots using legacy. I looked into Bakery Volumes a bit but I couldn't find too much material on how to set them up properly with my existing shaders (especially with HDRP). Please correct me if I'm wrong, but as I understand it, all dynamic objects to be affected by a Bakery Volume need to be using Bakery shaders or Bakery Shader Graph nodes included in their own shaders?

    I am not too comfortable working with shaders & shader graph and thus have stuck with light probes so far.

    As you can see in the screenshots though, legacy light probes aren't performing much better.
     

    Attached Files:

    Last edited: Apr 1, 2022
  30. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    935
    I have some issues with updating Bakery.
    Curl error... with the integrated search for patches solution.
    So i cloned manually the last 3 weeks.
    Since yesterday even the clone of the repros doesn t work anymore.
    Was there some change in update procedure or git aaccess?
     
  31. Zoidberg656

    Zoidberg656

    Joined:
    Sep 26, 2018
    Posts:
    16
    That's the thing. I DO use the legacy light probe mode and my skyboxes and environment are set to pitch black. It still takes into account if the skylight component is enabled or not. (The "Mansion_skybox" is pitch black.)
    settings.jpg
     
  32. SGJbrown

    SGJbrown

    Joined:
    Jul 9, 2021
    Posts:
    4
    Any update on when support for Unity 2021.2.3 might be happening? We'd like to use Bakery on one of our projects at Schell Games (Using Unity 2021.2.3) but the reflection probes are not working. It's one of the issues that you responded to on Feb 8th. I get these warnings when I bake. And if I switch scenes and then reload the scene the reflection probe looses it's baked texture.
     

    Attached Files:

  33. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,120
    Hi,
    what intensities are we supposed to use for bakery in HDRP? Do I stick with lux values? This goes for normal lights and in particular Sky light.
     
  34. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'm having a CUDA crash with RT Preview (using URP with Unity 2021.2.19f1) which only happens if I only have one spotlight in specific location.

    For example this works:


    but this crashes (nothing else has been changed but the X position):


    Also if I have two spotlights with both these locations, RT Preview is happy again. I'll try to get repro project sent.
     
  35. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Also noticed that while rendering in-scene view RT Preview straight up crashes the Unity Editor when testing it on 2022.2 alpha 9 (but granted this is not a released version, just noting it here for awareness). If using RT Preview in separate window it still works like it used to.

     
    guycalledfrank likes this.
  36. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    45
    I keep getting an error when trying to bake about a scene having "multiple lightmap storage objects."

    I'm trying to bake all of my scenes at once for a scene-streaming city.

    In the editor, I load up all scenes that could be streamed in, add the Bakery Direct Light and Skylight, add the Light Probe group, and hit Render.

    It will load for a while, and then the error will pop up and force me to stop the process completely.

    I've tried using the Bakery tool to clear all lightmaps and data, I've opened just the individual scene and tried to clear it that way, but I still get the error. I've also tried just deleting all of the lightmaps and lighting data from the scenes and starting over. And sometimes the scene it's referring to doesn't even have any meshes or lights to bake.

    Thoughts?
    Is there a way to clear out any and all lightmap storage devices it may be referring to?
    Is there a way to expose the data to the inspector so I can see what it's talking about?

    Thank you!
     
    Last edited: Apr 12, 2022
    guycalledfrank likes this.
  37. Daniel_Dickinson_RCad

    Daniel_Dickinson_RCad

    Joined:
    Apr 3, 2021
    Posts:
    9
    Hey Mr F

    I'm getting these strange edge artefacts. I've updated to the latest version & tried just about every combination of settings I can think of. I've even tried subdividing the geo to give it more geometry to adjust sample points from.

    I've tried with spot light setups as well. The issue persists & doesn't appear related to the lights used.

    Images say a thousand words, so I've attached a bunch to demonstrate the issue, as well as my current light, scene & global settings.

    Any help would be appreciated, I've been stuck on this for a while & am at a loss.

    Cheers,
    Dan
     

    Attached Files:

  38. kobechenyang

    kobechenyang

    Joined:
    Jan 16, 2013
    Posts:
    6
    Hello I am really enjoying GPU bakery so far. I am wondering if it is possible to make the bakery volume to work with unity ECS/DOTS with HDRP?
     
    Last edited: Apr 13, 2022
  39. VirtualDestructor

    VirtualDestructor

    Joined:
    May 3, 2014
    Posts:
    40
    I am running into a frustrating issue (using Unity 2021.3.0f1). Here is the sequence of changes that led to it:

    1) I was using built-in before. I switched to URP (I rebaked the lights and everything worked fine)
    2) After a few weeks I changed the output directory for the lightmaps, which had been the same for months.
    3) I rebaked the lighting, and everything looked super bright.

    I'm really confused how a directory change could result in drastically different bake results. After several hours of investigation I ended up restoring the original directory. Everything works fine now even if I rebake.

    I tried a few things to no avail:
    1) Downgrading to Unity 2021.2.18.
    2) Upgrading to the latest Bakery from Github.
    3) I noticed that the inspector for Bakery Point Light said "falloff doesn't match URP" so I set "Physical Falloff" to true (previously it was false). This seemed to fix the issue with everything looking super bright, but now my light volumes are hardly receiving any light. I have to turn the light intensity up really high to get the volumes to have the correct amount of light, but then the baked direct lighting is way too bright. Bakery Preview seems to be showing the scene how I would expect it to be (less bright). The image below shows the difference between baked results and preview.

    My game depends on light volumes so this is a showstopper. I'm using Bakery 1.9. Any help is appreciated.

    Other notes: Platform is Android, but these are problems I'm experiencing in the editor. I'm using linear color space.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      1.5 MB
      Views:
      263
    Last edited: Apr 15, 2022
    smurbotooth likes this.
  40. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    This is now fixed on latest from github.
     
  41. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,627
    Sorry for the delay.
    - Still in the process of relocating (lots of paperwork)
    - Got sick for a few days (I'm OK now)
    - Also working on the game in parallel


    Yes there are. Will do it soon.

    I would just bake the station normally, but without the global lights (Sun), having these realtime instead. Should work. Just probably don't use SH lightmaps, as my default shaders assume the data is world-space (or patch the shader to rotate the normals back to unrotated pose before sampling).

    ...true. You can try my existing graphs (e.g. BakeryVolumeGraph.shadergraph, it's in Bakery_ShaderGraphHDRP.unitypackage)

    Oh. Yeah, doesn't look good. It can be possibly related to very high intensity values used typically in HDRP scenes.
    Can you try this solution? https://forum.unity.com/threads/bak...preview-released.536008/page-107#post-7329469

    Or basically replace ftAdditionalConfig.cs with the attached copy.

    @atomicjoe you used Legacy Light Probes a lot, and you contributed to their optimization. Do you think I should use these modified coefficients by default and it looks better in most scenes?

    It's network-related. It can't download the file for some reason (firewall?)

    No, I don't remember changing anything and I haven't heard such reports from others. So perhaps something in your network? :confused:

    Hmm it can't. It's not the skylight, it's something else. Can you send me any small test project/package?

    Maybe it's just a specific 2021.2.3 bug? I currently have 2021.2.4 open and I tried it there on example_sponza_day, and it worked (including scene switching):

    upload_2022-4-16_13-56-40.png

    ... even without any console errors.

    Maybe try completely deleting the lighting data assets mentioned in your warnings, as they'll be regenerated.

    Thanks! Received, reproduced, found the bug, fixed, uploaded the patch o_O

    Yeah this looks like Unity alpha bug to me (something related to their virtual texturing system? does it break when overriding scene view shaders now?)... let's see if it gets fixed in the release version.

    Not sure how it ended up like this, but please try clearing your baked data before rendering:
    Bakery -> Utilities -> Clear baked data -> Clear (maybe do it a couple of times, in case it only deletes one storage object)

    You don't need to do that. "Multiple storage objects" is just multiple copies of "!ftraceLightmaps" gameobject in your scene (for some reason).

    Yeah, you can also try my debug tools: https://geom.io/bakery/wiki/index.php?title=Community_extensions#Debug_Tools

    Close Bakery window, click Bakery->Debug select storage. If something is selected, you can delete it (having Bakery window open will create it again).

    Really weird stuff. If it's only geometry-related, can you send me a mesh of this room? I'll run some tests on it.

    I don't know, I never tried this combination... does ECS/DOTS affect HDRP rendering in any way? Do you just want to replace the volume component with the ECS version? If so, it's likely doable. Volume components are rather simple.

    Interesting. Can you compare texture asset import settings from different directories? There must be something different about them.

    Volumes are computed the same way as lightmaps (if you mean BakeryVolumes). What shaders are you using for the lightmap-lit/volume-lit objects?
     

    Attached Files:

  42. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    Absolutely, yes.
    It's the first thing I change every time I update Bakery :p

    Either that or put a dedicated checkbox on the fancy preferences section named "Dering Legacy Light Probes" that enables or disables that 0.6 multiplication
     
  43. kanestudio

    kanestudio

    Joined:
    Jan 29, 2018
    Posts:
    7
    Hello, is there any way to increase the shadow brightness? I tried using AreaLight and Skylight and Reflection Probe to increase the brightness, but it didn't work well. I have a scene with containers and I don't want all the containers to have Lamps.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      93.2 KB
      Views:
      241
    • 2.jpg
      2.jpg
      File size:
      101.3 KB
      Views:
      219
    • 3.jpg
      3.jpg
      File size:
      55.5 KB
      Views:
      216
    • 4.jpg
      4.jpg
      File size:
      39.1 KB
      Views:
      217
    • 5.jpg
      5.jpg
      File size:
      29 KB
      Views:
      244
  44. kanestudio

    kanestudio

    Joined:
    Jan 29, 2018
    Posts:
    7
     

    Attached Files:

    • 6.jpg
      6.jpg
      File size:
      31.8 KB
      Views:
      226
    • 7.jpg
      7.jpg
      File size:
      118.4 KB
      Views:
      217
    • 8.jpg
      8.jpg
      File size:
      62.2 KB
      Views:
      221
    • 9.jpg
      9.jpg
      File size:
      93.7 KB
      Views:
      228
    • 10.jpg
      10.jpg
      File size:
      80.4 KB
      Views:
      220
  45. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    You can increase the "Indirect Boost" in the render options to 2 or more and try. (in advanced and experimental modes)
     
  46. VirtualDestructor

    VirtualDestructor

    Joined:
    May 3, 2014
    Posts:
    40
    That was it. The texture types for the new lightmaps are always set to "Default." Using the new "parallel asset import" feature in Unity 2021 is what breaks it. After some investigation, I've found that ftTextureProcessor.OnPreprocessTexture() is returning right at the beginning. Turning off parallel asset import resolves the issue (but you have to change the output directory again). I'm not sure if this is a known issue. Note that you will not see this issue until you change your Bakery output path to a new path (if you are using a path that previously worked then it will not happen). I found that OnPreprocessTexture() is returning on this third line:

    Code (CSharp):
    1.     void OnPreprocessTexture()
    2.     {
    3.  
    4.         TextureImporter importer = assetImporter as TextureImporter;
    5.         Vector2 settings;
    6.  
    7.         if (!texSettings.TryGetValue(importer.assetPath, out settings)) return; // returns here if parallel import is used
    Steps to reproduce:

    1) In a Unity 2021.3 project, enable the parallel asset import feature.
    2) Open a scene that baked correctly before (using Bakery).
    3) Change the bakery output path to one you have never used before.
    4) Bake the lightmaps by clicking the render button.
    5) The bake results should be wrong. Check the import settings on the lightmap textures, the textures that should be of type "lightmap" are of type "default."

    Note that I am using URP.

    _________________

    As for the shader types, I am using your "Volume Rotatable" shader graphs. Is there a reason there is not a "Volume Rotatable Specular" graph? I made one and it seems to work, I'm not sure if it is mathematically correct. That said, the light volume issues were probably due to the same import problem, or the fact that I was confused that the light volume results were inconsistent with the lightmap textures.
     
    Last edited: Apr 16, 2022
    guycalledfrank likes this.
  47. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    Unity 2021 LTS is a nightmare.
    Maybe the worst version of Unity I have ever encountered. And I've been here since Unity 3...
     
    guycalledfrank likes this.
  48. Daniel_Dickinson_RCad

    Daniel_Dickinson_RCad

    Joined:
    Apr 3, 2021
    Posts:
    9
    Hey

    I've attached one of our mid-size units to test with. Thanks for your help.
     

    Attached Files:

    guycalledfrank likes this.
  49. Augis1980

    Augis1980

    Joined:
    Sep 23, 2014
    Posts:
    48
    Hi, i am trying to use sectors, and ran into the problem:
    I made 2 sectors. I bake 1, its fine, I bake second, it ruins uv's of the 1st one. I bake the 1 again, its fixed, but the 2 one is gone. Am I missing something?
     

    Attached Files:

  50. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,866
    guycalledfrank likes this.