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. Dismiss Notice

World Normals to Screenspace Normals

Discussion in 'Shaders' started by Wahooney, Jul 15, 2014.

  1. Wahooney

    Wahooney

    Joined:
    Mar 8, 2010
    Posts:
    281
    Hey everybody!

    Can anyone tell me how to convert a WorldNormalVector to a normal in screen space?

    I've been googling for the past hour with no results... :(

    Thanks!
     
  2. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    How did you end up with world-space normals in screen-space? Is this something Unity's built-in Deferred path does?

    Not sure if you want cam/eye/view-space since "screen space" is 2-dimensional ;) is this in a post-processing shader or in a surface shader?
     
  3. Wahooney

    Wahooney

    Joined:
    Mar 8, 2010
    Posts:
    281
    I didn't :p That's that I need.

    Camera or screen space would do (I'm only interested in the .xy anyway), it's a surface shader. So what I think I need is a _World2Camera matrix, which doesn't seem to exist, sadly;.
     
  4. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    349
    It's seems UNITY_MATRIX_V