Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

HDRP and flat shading

Discussion in 'Graphics Experimental Previews' started by darkydoodle, Mar 26, 2019.

  1. darkydoodle

    darkydoodle

    Joined:
    Oct 27, 2018
    Posts:
    54
    I want to try flat shading on my procedural terrain. Before HDRP, i'd use this :
    Code (CSharp):
    1. normalize(cross(ddx(worldPos.xyz), ddy(worldPos.xyz)));
    In a custom node in shader graph and and pass it to the normal in the master lit node.
    But with HDRP, this is not working. The lighting of the models is completly wrong. I also tried to use the ddx / ddy / cross product / normalize nodes of shader graph to obtain the result, but of course it's doing exactly the same. Does someone know why this is not working in HDRP / shader graph ?
    Thanks !
     
  2. darkydoodle

    darkydoodle

    Joined:
    Oct 27, 2018
    Posts:
    54
  3. dmchaderer

    dmchaderer

    Joined:
    Nov 13, 2019
    Posts:
    6
    bump on this one.
    I'm also trying to use ddx/ddy with HDRP 7.3.1
    I think it is returning nan or infinity or something.
     
unityunity