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

WorldNormalVector in Shader Graph

Discussion in 'Graphics Experimental Previews' started by Zipe92, Nov 3, 2018.

  1. Zipe92

    Zipe92

    Joined:
    Mar 5, 2015
    Posts:
    27
    Hello,

    I just started to learn how to use Shader Graph, and now I'm trying to convert one shader that I found years ago.
    This shader uses the "WorldNormalVector(IN, o.Normal)" function but until now I have not been able to find it in shader graph, someone can tell me which node I have to use to reproduce it?
    Thank you in advance.
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    In Shader Graph this is the Position node with the space set to World
     
  3. Zipe92

    Zipe92

    Joined:
    Mar 5, 2015
    Posts:
    27
    Thank you for the answer, I tried the Position Node but it does not seem to work as expected. I have to convert only this simple line:
    Code (CSharp):
    1. f(dot(WorldNormalVector(IN, o.Normal), _SnowDirection.xyz)>=lerp(1,-1,_Snow))
    My graph is:
    graph.png
    But with Position Node the Comparison returns always True