Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Question 2D Reflection Shader not working in Game View.

Discussion in 'Shaders' started by Ekincan, Nov 3, 2020.

  1. Ekincan

    Ekincan

    Joined:
    Sep 8, 2015
    Posts:
    57
    Hey.
    I am sort of new to shaders.

    I was trying to create a 2D Water Reflection Shader.
    And it works fine in the scene view and camera preview.

    But its not properly flipped in the Game View.

    I am quite bummed out about this.

    I created the shader in shaderforge.
    After experimenting I figured out the root cause:
    Screen Position UV: I have to OneMinus the Y for Game View but not Scene View.


    How can I keep this consistent, this is very annoying :(
    Shouldn't basic things like this be consistent why is it randomly different for no reason.
     
  2. unity_rol

    unity_rol

    Unity Technologies

    Joined:
    Nov 4, 2020
    Posts:
    8
  3. Ekincan

    Ekincan

    Joined:
    Sep 8, 2015
    Posts:
    57
    Thanks for the help :D
    At least by using UNITY_UV_STARTS_AT_TOP I can work around the problem.
     
  4. Ekincan

    Ekincan

    Joined:
    Sep 8, 2015
    Posts:
    57
    An Update: Works fine now.
    I had to use both _ProjectionParams and UNITY_UV_STARTS_AT_TOP.