Search Unity

Question Main Preview In Shader Graph Is Blank

Discussion in 'Shader Graph' started by MidnightSkyGD, Mar 15, 2023.

  1. MidnightSkyGD

    MidnightSkyGD

    Joined:
    Dec 13, 2021
    Posts:
    7
    Greetings,

    I hope this is the right forum.

    My Main Preview in Shader Graph has been empty for a while now. I have tried clicking and dragging in the Main Preview window, but nothing changes. I have also tried different meshes, but it doesn't change. Not even a gray mesh. I have closed and opened the Main Preview. I have closed the Graph and reopened it. I have tried different Shaders. I have tried different projects, but it is all the same. I am using 2021.3.20f1, was using 2021.3.3.1f1, where the problem started. I have rebooted my computer, and restarted Unity multiple time. I haven't been able to find anything from Google Searches, so I am pretty lost, and having to save the shader and go into scene view for each change is getting bothersome.





     
  2. wesleyhunter

    wesleyhunter

    Joined:
    Sep 28, 2018
    Posts:
    1
    I'm having the same trouble :(
     
  3. MidnightSkyGD

    MidnightSkyGD

    Joined:
    Dec 13, 2021
    Posts:
    7
    One thing I have noticed about this, is if I have the surface type set to Transparent, it works fine, and I get the preview, but if it is set to Opaque, it does not display.
     
    silverlui1104 likes this.
  4. Socks

    Socks

    Joined:
    Jan 24, 2013
    Posts:
    34
    I have the same issue, like IntrovertGenius says above, the only solution I've also found is to set the surface to transparent (in Graph Settings) . . . but obviously this isn't ideal as it changes the available modules . . . the other (much slower and less interactive) solution is to have the scene and/or game window open, with the shader applied to a game object, then every time you hit Save Asset in Shadergraph the object's material is updated . . . neither are perfect solutions, but you can sort of botch your way through.
     
  5. MidnightSkyGD

    MidnightSkyGD

    Joined:
    Dec 13, 2021
    Posts:
    7
    Yes, I have to Save Asset to see the changes, and depending on the complexity of the Shader Graph, I could imagine that would get very time consuming. I am just learning Shader Graphs via online course, but I am starting to see how non-ideal this is. I haven't found any solutions anywhere, and I've asked a few times in the Discord, and haven't gotten replies there either.
     
  6. Socks

    Socks

    Joined:
    Jan 24, 2013
    Posts:
    34
    In searching for a solution I can see the issue has been around for - literally - years, I'm guessing it's some sort of issue specific to a person's graphics card / graphics set up, and probably doesn't effect the other 99.9% of people, otherwise I guess it would have been addressed, as the issue has been around for such a long time.
     
    Last edited: Mar 28, 2023
  7. MidnightSkyGD

    MidnightSkyGD

    Joined:
    Dec 13, 2021
    Posts:
    7
    Lovely. Oh well, guess there is nothing we can do.
     
  8. Socks

    Socks

    Joined:
    Jan 24, 2013
    Posts:
    34
    Maybe list your computer / graphics card here . . . . over time, with enough entries a pattern might emerge, which should make it easier for Unity to address . . .

    I'm on an old 27" iMac from 2013 (wow, a decade old !)
    Graphics = NVIDIA GeForce GT 755M 1024 MB
     
  9. MidnightSkyGD

    MidnightSkyGD

    Joined:
    Dec 13, 2021
    Posts:
    7
    Windows 10 64-bit.
    Intel i7 4.0 GHz
    64 GB Ram
    Nvidia GeForce RTX 3090 Ti 4083 MB

    While this has happened in other versions too, I am currently doing a project in Unity 2021.3.20f1.

    Not sure what else to put.
     
  10. Socks

    Socks

    Joined:
    Jan 24, 2013
    Posts:
    34

    Yeah, forgot to add that ! I'm also on version 2021.3.20f1 . . . and it also happened on previous versions (which suggests to me it's my machine)
     
  11. jchmelik

    jchmelik

    Joined:
    Jun 1, 2013
    Posts:
    1
    Exactly the same problem here... workaround with setting the surface to "transparent" also works for me, but would be nice to have some proper solution.

    Unity 2021.3.18f
    Windows 10 64-bit
    Intel i7 10750H
    32 GB RAM
    Nvidia GeForce RTX 2070
     
  12. gamegamesgamedev

    gamegamesgamedev

    Joined:
    Aug 2, 2020
    Posts:
    3
    Same issue with me. The "transparent" workaround also works.

    Unity 2021.3.19f1
    Windows 11 64bit
    12th Gen Intel(R) Core(TM) i7-12700K
    32.0 GB RAM
    NVIDIA GeForce RTX 3070 Ti

    Google searches seem to indicate that this has been a problem since Unity 2019...I wonder if it's been fixed in later versions...but I just don't want to mess around with updating the program mid-development.
     
  13. iidamyanov

    iidamyanov

    Joined:
    Mar 22, 2021
    Posts:
    1
    Preview empty on Unity 2022.2.15f1, Windows 10, Nvidia 3070 Aorus
     
  14. DagoPico

    DagoPico

    Joined:
    Feb 12, 2023
    Posts:
    2
    I, too, have encountered the same problem, though,
    I encounter it when I start a project with a 3D (URP) template.
    Perhaps this is a bug in Unity.

    In my environment, I found that it develops when using URP-HighFidelity.
    If you have no problem with the other option, there is a solution.

    First, in the "Graphics/Scriptable Render Pipeline" in the project settings
    URP-HighFidelity" is set in the "Graphics/Scriptable Render Pipeline" in the project settings, please change it to "URP-Balanced".

    Next, change the "Quality/Render Pipeline Asset" setting in the project settings to "URP-Balanced" as well.
    If the ShaderGraph window is open at this point, close it.
    Then open the ShaderGraph window again and check the MainPreview.
     
    Azura3D, MrVandheer and Woink like this.
  15. Tomyn

    Tomyn

    Joined:
    Jan 19, 2018
    Posts:
    5
    I can confirm da55r's solution posted above works. Thanks a ton da55r for sharing this!
     
  16. MrVandheer

    MrVandheer

    Joined:
    Dec 28, 2020
    Posts:
    4
    I can confirm da55r's solution posted above works. Thanks a ton da55r for sharing this!
    Work for me too, thanks!
     
  17. StinkySteak

    StinkySteak

    Joined:
    Jul 7, 2017
    Posts:
    12
    Confirmed Works on Unity 2021.3.21f1
     
  18. PVusanGamse

    PVusanGamse

    Joined:
    Jul 16, 2020
    Posts:
    1

    Thank you for your answer, but can you make some with screenshots? I cant find any of this in my settings :c
     
  19. DagoPico

    DagoPico

    Joined:
    Feb 12, 2023
    Posts:
    2
    Explanation with images.
    The version of Unity in the description is 2031.3.25f1.


    First of all, this problem is that the main preview may not be displayed correctly in the shader graph editor,
    as shown in image 1.
    Normally, the shading set here in the editor should be reflected in the preview object.
    However, in some cases, this does not happen and a flat gray display is produced.


    This is happening because the Render Pipeline Asset in the project settings is set to "URP-HighFidelity."
    Click on the small button to open the asset window, as shown in Image 2,
    and change the setting to "URP- Balanced" in the asset window.


    Then, as shown in Image 3,
    change the Render Pipeline Asset item from "URP-HighFidelity" to "URP-Balanced" for the Quality setting as well.


    Now check if the preview is reflected as shown in image 4.


    However, this will not work in cases where the Render Pipeline must be URP-HighFidelity,
    in which case you will need to consider a different solution.
     

    Attached Files:

    Last edited: Oct 6, 2023
  20. unity_0_40QMs7E_lgFw

    unity_0_40QMs7E_lgFw

    Joined:
    Sep 28, 2020
    Posts:
    1
    You can keep the URP-HighFidelity.

    You only need to edit the "URP-HighFidelity-Renderer".
    Under the SSAO (Screen Space Ambient Occlusion), they have Source marked as "Depth Normals".

    Just change it to "Depths" and choose your quality. (I chose "High" quality).
    If the Shader Editor is open, you will need to close it and re-open it again.

    You should now see everything correctly.

    fix it.gif
     
    DagoPico and frankfringe like this.
  21. Greatwaller

    Greatwaller

    Joined:
    Jun 2, 2023
    Posts:
    1
    It's simple to solve it: Click Windows>Layouts>Default. I have tried it and it works.
     
    MaxFisherEmrich likes this.
  22. Lakshmi012

    Lakshmi012

    Joined:
    Mar 11, 2024
    Posts:
    1
    ✅ Found one more solution: Click the 3 dots on the top right corner of shader editor > Enable UI Toolkit live reload option. It works. Then the main preview shows the mesh. :D
     
    IC_ likes this.
  23. Shashimee

    Shashimee

    Joined:
    Nov 1, 2017
    Posts:
    8
    That was it for me ! Thanks
     
  24. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    64
    This is the solution, thanks!