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
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

HDRP Lit Shadergraph shader problem with shadows and textures

Discussion in 'Graphics Experimental Previews' started by DisastermanTV, Feb 17, 2019.

  1. DisastermanTV

    DisastermanTV

    Joined:
    Dec 18, 2014
    Posts:
    2
    Hello everyone,
    so as I'm currently playing around with the shader graph, I saw an question on how to create low poly water effect with the shadergraph. The base idea is to have a base plane consisting of triangles, and then moving the vertices up and down with a scrolling gradient noise.

    With an Unlit shader everything works fine, except that every triangle looks the same without any shading. (Which is expected for unlit)

    But when i moved to a lit shader in the HDRP the following shading problem arose:


    On the one hand the extremely dark shadows, even tho the directional light is shining directly from above, and on the other hand the weird blue color problem. The displacement of vertices still works tho.
    This is my shader graph:

    Otherwise I'm only using a default material with the shader applied, and the model is an .fbx plane from blender which i subdivided and triangulated.

    Hope someone knows what's going on.

    Thanks in advance,
    Best Regards
    Luca
     
  2. ReMix3D

    ReMix3D

    Joined:
    Sep 9, 2012
    Posts:
    14
    Hello,

    What's happening here is that you're modifying the vertex positions, but not the normals, thus the direct lighting is still affecting the surface as if it was flat.
    You can use something like the "Normal From Height" node to generate proper normal values from the noise, and plugit to the normal output.
     
  3. DisastermanTV

    DisastermanTV

    Joined:
    Dec 18, 2014
    Posts:
    2
    Okay, that is definitely missing, thanks !
    But when i plug the Vector3 position into Normal from Height (with tangent space), not much happens. Also when i only plug in the y/z coordinate it stays the same. Using the node in world space spreads the effect on many more triangles ,so that nearly everyone is affected.

    Any ideas?
     
  4. PatrikL

    PatrikL

    Joined:
    May 11, 2014
    Posts:
    6
    Did you ever find a solution to this problem?
    I've encountered something very similar with a billboard shader. Displacement is working fine, but shadows are acting as if the billboard was never rotated.
     
  5. SupinePandora43

    SupinePandora43

    Joined:
    May 13, 2019
    Posts:
    18
  6. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    708
    Anyone found solution for this?