Search Unity

Question Realtime shadow artifacts when rotating vertices

Discussion in 'Shader Graph' started by grllle, Dec 4, 2019.

  1. grllle

    grllle

    Joined:
    May 4, 2015
    Posts:
    28
    Hi there,

    using 2019.2, i want to rotate meshes within a vertex shader but i get artifacts on the surface. Those go away when i turn of realtime shadows. For baked ones the shadow on the mesh rotates as well so it feels like i'm just missing a point here.
    Any help / hint how to fix this is appreciated!!


     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    When you rotate a mesh you need to also rotate the normals, both for shading and shadow map biasing to get the correct results.

    Unfortunately this isn't currently possible with Shader Graph. Basically there is no way to rotate a mesh using a real time lit shader graph and get correct shadowing results.

    If you want the lighting, including the shadows, to rotate similar to what happens with baked lighting, this isn't possible regardless of using Shader Graph or not as the orientation for shadows on opaque objects can't be modified by the shader used on an object.
     
    grllle likes this.