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

Resolved Skybox covering transparent material (2022.2.0b10)

Discussion in '2022.2 Beta' started by adamgolden, Oct 15, 2022.

  1. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    Earlier today I noticed some transparent shader content was missing from scenes, in both live builds and in Play Mode (but not in SceneView). I'm sharing this tip because before working out what was going on, I spent a lot of time digging - thinking about how I might have broken related code somehow, changing and removing customizations to URP, attempting to downgrade project to 0b9, trying asset reimports and deleting Library folder numerous times at various steps along the way, but pretty much just when I was ready to accept I couldn't do anything about this... FINALLY... one last shot.. and got all content visible again.

    The cause? My skybox! An unlit, opaque Shader Graph assigned to RenderSettings.skybox. For some reason the Depth Write dropdown must now be set to ForceDisabled (well, changing the graph to transparent fixes it too, but that's likely a bad choice where performance is concerned). Previously this was set to Auto. Don't know why suddenly this matters and don't care. I've tested the fix in Play Mode and a WebGL build. Maybe setting it to that for skyboxes is what we're supposed to do, but I didn't know, so if that's the case, I guess I've learned.
    skybox shader graph workaround.jpg

    I'm flagging the thread Resolved instead of Bug because it's a simple solution with no drawbacks I've noticed or thought of so far. Hopefully this saves someone else from the same kind of adventure I've just had :rolleyes:
     
    Sluggy likes this.
  2. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    While it didn't save me the 'adventure' it did at least guide me to what was wrong. Thanks!
     
    adamgolden likes this.