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

HDRP and flat shading

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

  1. darkydoodle

    darkydoodle

    Joined:
    Oct 27, 2018
    Posts:
    64
    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:
    64
  3. dmchaderer

    dmchaderer

    Joined:
    Nov 13, 2019
    Posts:
    23
    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.
     
  4. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    I thought flat shading was the default material, you just change the color and that is your flat shaded material like Virtua Racing