Search Unity

URP - shader works only in game view

Discussion in 'Shaders' started by InAngel, Oct 29, 2020.

  1. InAngel

    InAngel

    Joined:
    Dec 30, 2017
    Posts:
    33
    Hello,
    I am using URP with unity 2019.4.8f1,
    Something really weird happened and the shader that I am using stop showing in the scene view.
    I was playing with the terrain and it just went kinda crazy.
    The material doesn't even look the same any more.
    upload_2020-10-29_12-26-16.png
    This is how the material looks when the game is not at play mode.
    As soon as I press play everything works just fine.
    upload_2020-10-29_12-27-41.png
    The game view sees it all perfectly even without pressing play.
    The problem is that in the scene view the material effects the object so the ocean is grey.
    The same thing happens with another water shader (this one makes the river white).
    It is difficult to change the terrain and the level design this way.
    At first I thoughted it was the camera that did it, maybe the depth texture,
    But if the materials look different in the editor between play and "edit" it is probably something else.
    Is there anything I can do to fix this?
    Thank you in advance :)
    (I am not sure if this is the right forum so if I got it wrong please tell me)
     
  2. InAngel

    InAngel

    Joined:
    Dec 30, 2017
    Posts:
    33
    Anyone?
     
  3. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    Make sure your scene for edit mode (in preferences) is the same as your gameplay scene, or has the same environment settings at least like ambient light etc.
     
  4. InAngel

    InAngel

    Joined:
    Dec 30, 2017
    Posts:
    33
    Everything is the same, I even toggled the skybox and all effects on so Everything looks like the game except water related materials that were active in the scene when it happened.
    I have a material from the same shader that works fine in scene view, Therefore I really don't get it.
     
  5. GeorgeMincila

    GeorgeMincila

    Joined:
    Feb 28, 2016
    Posts:
    36
    I am having the same issue a year later. Unity 2021.1.15f1
    I created a shader for a UI panel to look blurry. It is visible in the Game window, but not in the Scene window.

    If anyone has ideas, it would be great.