Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

[HDRP] Lightmaps not showing up and/or "un-hooking" from objects.

Discussion in '2019.3 Beta' started by Freznosis, Nov 12, 2019.

  1. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I have an issue where lightmaps are not showing up after being baked in the scene. Ported across my scene to test HDRP and got most of it working, except the lightmapping.

    Note: Subtle shadowing from ambient occlusion in lightmap on 2018.4 shows between objects.

    Lightmap View



    Shaded View


    Lightmap View



    Shaded View



    Take note, the lightmap isn't showing at all, even though the lightmap was just baked and shows up properly in the lightmap tab.

    Now what's weird, is that all objects in the scene have lightmaps assigned to them correctly. The lightmap view shows correctly. The lightmaps in the lighting window show up correctly. None of the lightmaps data change when saving, entering playmode, etc. There are literally no changes aside from the lightmaps not showing.

    Now what's even more weird, is that the lightmaps will completely unassociate themselves from the scene and the baked objects when the scene is reloaded or if Unity is closed and reopened.

    Right after baking the scene, all views show the lightmaps fine, except shaded view. For example, the Albedo view and Directional view show data correctly.

    Albedo View



    Directional View


    And now this is how the scene looks directly after reloading the scene or closing and opening Unity.

    Albedo View - Data is GONE



    Lightmap View - Data still showing in lighting tab, but not in lightmap view, No objects have lightmaps attached to them after reload. LightingDataAsset is pointing to the correct scene.


    Some more info. I am not positive if this is a Unity 2019.3 or HDRP exclusive problem, however all other Unity versions I've tested work fine, including HDRP builds. And this is the first time this is happening to me. So I decided to create a control project to make sure it wasn't my scene. Created new project in 2019.3 HDRP, completely stock project. 7.1.1 (Since 7.1.2 doesn't work) and created a plane with 4 boxes.

    The same thing is happening with this test project, which shows me that this is not a problem due to my project, it is a Unity problem.

    Has anyone had this problem as well? Create a new HDRP project in 2019.3b10 and bake lightmaps in a simple scene. Then close Unity and re-open Unity and then see if the same thing happens to you.
     
  2. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I just made a new HDRP project in 2019.2 and confirmed that this is indeed 2019.3 dependent.

    Any help on what could possible be going on? Or misunderstood?
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    We don't have anything logged for an issue like this yet. Could you please submit a bug report? Ideally with a minimal reproduction project.
     
  4. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I will try and submit a project. However seeing as it happens with a default newly created project, I'm not sure what good it would do :)

    I'll also give beta 11 a try with the new 7.1.2 pipeline in case something may have fixed it.
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    If that demonstrates the issue, please submit it :).
     
  6. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    It seems the newest HDRP made the lightmaps start working again. Although the lightmap view is still not showing anything. I don't know how I would report an issue like this. Doesn't seem to be reliably reproducible to be submitted.

    Unity_2019-11-18_14-39-38.png
     
  7. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I confirm that for Unity 2019.3, too. When I bake a lightmap, I use the GPU lightmapper, everything seems to be fine.
    But if I restart the editor and change the scene view for example to "Baked Lightmap", it just shows me the scene with a transparent checker board pattern despite the baked lightmap. Basically no lightmap scene view works, like Texel Validity.

    How to inspect that if I do not want to rebake everything?
     

    Attached Files:

    Freznosis likes this.
  8. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  9. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Known since January and still not fixed?
    I don't get how the code has to look like in order to fail showing the lightmap after restarting the editor. I mean the lightmap is still recognized in Lighting window.
     
  10. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    I have a Unity 2019.2.0 project which has this broken lightmap issue. Specifically I have an interior set which includes light fixtures with emissive textures. The results of the baked emissive can clearly be seen in the baked debug scene view. However the objects are black in game and when viewed in shaded mode. I initially thought it was a post processing exposure issue, but have since ruled this out. The best way I can describe it is the lightmaps just aren't being applied to the scene objects.

    I created a small example project. Load the scene titled "brokenEmissive" to see the issue.

    Thanks,
    Nathaniel
     
  11. Deleted User

    Deleted User

    Guest

    I'm getting this in 2020.2, baked lightmaps are black.
     
  12. JackmanGomel

    JackmanGomel

    Joined:
    Jun 3, 2015
    Posts:
    26
    I have the issue Unity 2019.4.15f1 HDRP 7.3.1
    upload_2021-4-13_2-39-33.png
    upload_2021-4-13_2-39-50.png
     
  13. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    The pink usually means there's an issue with the shader. Unity did look at my issue and their answer was that the objects were metal. if I wanted to see the result of the baked lighting I'd need to dial back the metallic properties. Kinda makes sense, since metal is a specular component and GI is about diffuse lighting. However, I wanted the baked shadows to still impact the metal surfaces, which it wouldn't do.