Search Unity

Image Effects / Post Processing different in Scene View

Discussion in 'Image Effects' started by Alex_curiscope, Sep 7, 2017.

  1. Alex_curiscope

    Alex_curiscope

    Joined:
    Apr 4, 2017
    Posts:
    55
    Unity 5.5.0f3.

    I have an image effect that calculated fog based on distance.

    The shader does *not* calculate fog using linear depth, it uses the linear depth to calculate the distance by multiplying that value by the world direction, which is interpolated from frustum edges. I know that this works because in the game view, changing the camera far plane has no effect on the fog levels.

    In the Scene View the fog looks different. Any idea why this might be?

    We really need this to work properly in order to lay out the level assets correctly.

    upload_2017-9-7_11-14-33.png
     
  2. Alex_curiscope

    Alex_curiscope

    Joined:
    Apr 4, 2017
    Posts:
    55
    Also, shouldn't the image effect work when you are using "Shaded wireframe" mode in the Scene View? It doesn't.
     
  3. Michal_

    Michal_

    Joined:
    Jan 14, 2015
    Posts:
    365
    I had a similar problem where image effect looked different in scene view. It turned out to be a numerical precision problem caused by ridiculous far plane (several million units).
    Limiting scene view camera far plane to some reasonable value fixed the issue for me. Maybe you have the same problem?
     
  4. Alex_curiscope

    Alex_curiscope

    Joined:
    Apr 4, 2017
    Posts:
    55
    Yeah that might do it. In the end we created a script to make a camera match the scene view camera's parameters, and updated it whenever the scene view repainted. This gave us a game view window that showed exactly what the scene view was showing except it looked correct.