Search Unity

Question Why does shader graph do the opposite than it previews? + SG UV coordinates wrong?

Discussion in 'Shader Graph' started by Flow-Fire-Games, Aug 2, 2019.

  1. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    I am confused, my health bar shader is the literal opposite of the shader graph preview

    Also I had to turn the plane around 180°, as the UV node did not seem to correspond to the default object UV direction

    Or am I doing some very stupid mistake? I'm very confused




    Here you can also see that the shader graph UV coordinates are wrong
    If I just input the UV into color, I get a 180° flipped result, on a Unity plane, cinema 4d export plane and unity cube. So its clearly shader graph being wrong.



    180° flipped


    Unless I'm being very stupid, something is very odd there. Just updated to 2019.2, HDRP
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Shader graph is showing a basic set of UVs with 0.0, 0.0 in the bottom left and 1.0, 1.0 in the top right. The UVs on meshes are completely arbitrary in their orientation. Neither are wrong, there's just no guarantee they match unless you manually orient the meshes to do so.
     
  3. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    UVs on meshes are not arbitiary unless you randomly assign them, and neither the Unity Plane or Cube are arbitrary, the Cinema 4D plane also starts their UV starts 0,0 at bottom left and are rotated correctly, I just checked it in my UV editor. Something with shader graph seems to be buggy.


    For the shader issue, turns out the Power node was the issue, clamping before not after to fix it solved it + rotating the plane 180° and making it double sided to fix the UV bug
     
    Last edited: Aug 5, 2019
  4. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    On the newest version, Shader graph freezes every time a new texture reference is added btw, very annoying