Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved Depth Offset Bug HDRP

Discussion in 'High Definition Render Pipeline' started by NarberalTools, Jun 2, 2022.

  1. NarberalTools

    NarberalTools

    Joined:
    Jul 8, 2019
    Posts:
    51
    When I was doing the ParallaxOcclusion code for my URP+ pipeline following the HDRP example, I noticed a bug (or I'm wrong).
    In HDRP code we multiply viewTS by GetDisplacementObjectScale():
    Code (CSharp):
    1. float3 viewDirTS = isPlanar ? float3(uvXZ, V.y) : TransformWorldToTangent(V, input.tangentToWorld) * GetDisplacementObjectScale(false).xzy;
    But if we do not do this, then DepthOffset will work more correctly. Here are the screenshots:
     

    Attached Files:

    PutridEx likes this.
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    932
    Hi, thanks for reporting this, we will insvestigate why there is such a behavior.
     
    NarberalTools likes this.
  3. NarberalTools

    NarberalTools

    Joined:
    Jul 8, 2019
    Posts:
    51
    A very strange bug. The DepthOffset in general works very oddly with Pixel Displacement. It's not GetDisplacementObjectScale fault.
     
    Last edited: Jun 3, 2022
  4. NarberalTools

    NarberalTools

    Joined:
    Jul 8, 2019
    Posts:
    51
    oh, sorry, I didn't understand it well enough, I didn't know that i need Primitive Length and Primitive Width for this