Search Unity

Pixel displacement at low angles

Discussion in 'High Definition Render Pipeline' started by Awarisu, Sep 11, 2019.

  1. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    It seems that HDRP has a worse degradation behavior when it comes to height maps than the old standard pipeline. Testing on 2019.3.0b2 and HDRP 7.0.1.

    Repro:
    * Make a cube, scale it to be tall and wide so it's a piece of wall
    * put a height mapped material on it (HDRP/Lit or HDRP/LitTessellation work just as well)
    * Use Pixel displacement, Uncheck "Lock With Object S" because that just looks silly with the material transforming depending on your camera's height
    * It mostly looks OK, but if you start to look at the wall at a really close angle, you can see that the texture starts to shift in relation to the world. I'm not expecting miracles when it comes to parallax mapping and small angles, but at least the old pipeline didn't shift the entire texture around as it was degrading, so I'd say overall it looked more believable as a wall.

    (the dream would be something like the texture smoothly fading to completely flat when this happens to avoid any kind of parallax artifact, but it's so rarely done in games that I'm not asking for it, I'd be happy if I could get the old behavior back)
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    HDRP uses Parallax Occlusion Mapping (aka Steep Parallax Mapping), whereas the Built-In pipeline uses a more old fashioned Parallax Mapping technique :

    https://en.wikipedia.org/wiki/Parallax_mapping

    The raymarching steps needed to make this work involves calculating a ray direction from the mesh surface, involving the use of the vertex normal, tangent and bitangent.
    But if you scale the mesh in a non uniform manner (what you are doing with a streched cube to act as a wall), you will cause wrong calculation for the steps length, inducing the degradation you are experiencing.

    TLDR: Avoid non uniform scale on your objects and you won't have the issue.
     
    Awarisu likes this.