Search Unity

Bug All assets appear black in preview

Discussion in 'High Definition Render Pipeline' started by IVANMARTINEZ94, Apr 22, 2023.

  1. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    Hi everyone,

    I'm having an issue with the asset preview in Unity 2022.2.15 with HDRP rendering pipeline. Basically, all assets in the project appear black in the preview window, but if I modify any property, they show up correctly. However, when I save the scene or restart the editor, the black preview comes back and makes it impossible to work with the assets.

    I've recorded a video showing the problem, which you can watch here: https://youtu.be/znZ4CQMrrl8

    I'm using the default lit shader that comes with HDRP for the materials, and the problem also happens with prefabs.

    Deleting the library and reimporting the entire project does not solve the issue.

    I just tested by creating a new project and importing the HDRP package. After creating a material, when I save the scene, the material preview turns black. This project doesn't have any other packages installed besides HDRP and its dependencies.

    Has anyone else experienced this issue, or knows how to fix it?

    Thanks in advance for your help.
     
    Last edited: Apr 22, 2023
    M4nTiC0re and Gasimo like this.
  2. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    109
    Having the same issue although it's inconsistent for me (doesn't happen for textures or imported FBX, only prefab'd materials+meshes). Only happens in HDRP as well.. I've created sample projects in URP and BuiltIn, those are fine.

    It's not an HDRP/pink materials issue, but one workaround is to use BetterLitShaders insead of HDRP/Lit (if you own it). Not terribly elegant but changing the shader fixes it for that item's preview.
     
  3. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    109
    Just updated to 2022.2.16.. seems to have fixed it for me. Or at least I haven't been able to repeat it since updating.. Normal HDRP/Lit shaders.

    Screenshot 2023-04-22 135405.png Screenshot 2023-04-22 135557.png
     
  4. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    First, thank you for your previous response, but unfortunately, I have updated the test project I created before and the issue still persists. Upon further testing, it seems to be related to the metallic option of the material. If it's set to 0, the material will appear completely black in the preview, and if it's set to 0.5, the material will appear partially darkened. I just created a new material to test it, and the same problem always occurs.

    In the image I uploaded, you can see the material configurations. On the far left is the first material with the metallic value set to 1, and to its right is the second material with a value of 0. In the inspector preview, the second material appears correctly, but in the project window preview, it appears completely black when saved.

    Captura de pantalla 2023-04-22 210424.png
     
    DrMeatball likes this.
  5. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    109
    Yeah beat me to it.. yeah not fixed after all. Random one off on my part..

    BetterLit or HDRP/Lit not making a difference either.

    Screenshot 2023-04-22 175911.png Screenshot 2023-04-22 180231.png
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I'm seeing this in 2021 LTS. Not sure if it was introduced in 2021.3.24, or I just didn't notice until now.

    Does anyone know if this is a tracked bug?
     
  7. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    it´s seems that in 2022.2.21 it´s fixed in hdrp, i think that these is the case: https://issuetracker.unity3d.com/is...project-tab-are-broken-after-switching-to-urp
    although it only talks about upr, it seems that in hdrp it is fixed, I have verified it in the same project that I use to answer this topic and when I modify a property of a material, all the previews are reloaded not only the material that is edited, I think this is not the best solution, but when I save the scene, the material previews are fine.

    upload_2023-5-26_10-59-29.png
     
  8. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    After updating my main project I see that it still has problems, now when you modify any property all the materials that are seen in the inspector are seen correctly but when you change folders or scroll they are black again, it is an improvement compared to how it was before but still having a lot of problems.
     
  9. minotaur2k16

    minotaur2k16

    Joined:
    Feb 4, 2017
    Posts:
    3
    I am having the same exact problem in my project and it's driving me crazy, as it makes browsing prefabs a nightmare, since they all are shown in pure black. I am using Unity 2023.1.11f1.

    Some pieces of information to help the Unity people find the cause:
    1. All materials using HDRP/Lit shader show as black in the project browser, unless you bring the "metallic" property way up.
    2. Upon changing any of the properties of the material, the preview looks fine again, but if you leave the folder and return, it goes back to being black.
    3. Reimporting and deleting the library and rebuilding it does not help.
    4. All prefabs using those materials will also show as black, both in the project browser and the preview window. However, upon dragging the object in the preview window to rotate it, the colors come back to life. This does not fix the previews in the browser, though!
    Not that easy to get work done on your project when your editor looks like this:

    upload_2023-8-31_13-53-23.png

    upload_2023-8-31_13-54-32.png

    Can someone please help?
     
  10. minotaur2k16

    minotaur2k16

    Joined:
    Feb 4, 2017
    Posts:
    3
    Anyone else having this issue? Any workarounds? Any fixes coming our way?
     
  11. dexmex001

    dexmex001

    Joined:
    Oct 9, 2019
    Posts:
    24
    Same issue for me in 2021.3.30 f 1, black materials and prefabs. like a black magic. With 3.14f1 was no mat / pref problem. Love when I update the project and all time have a new challenge...
    Someone have solution?

    Thank you.
     
  12. Guest_Unity_ID

    Guest_Unity_ID

    Joined:
    May 17, 2020
    Posts:
    5
    I had the same issue, HDRP.
    After updating my project to 2022.3.12f1, the problem was resolved.
    Finally, I can see my materials.
     
  13. unity_QJ7RazXzghZCzA

    unity_QJ7RazXzghZCzA

    Joined:
    Jul 9, 2021
    Posts:
    104
    Updated from 2021.3.30f1 to 2021.3.33f1 - fixed the issue.