top of page

Height Map and Parallax Mapping

In this blog, I will explain

  • Adjust UV using HeightMap

  • RayTrace HeightMap to find Occlusions.



o.Height = SAMPLE_TEXTURE2D(_PKDMAP, sampler_MainTex, uv0).b;
uv0 += ParallaxOffset1Step(o.Height, _HeightMul, d.tangentSpaceViewDir.xyz);
///// Parallax Maping for HeightMap, Taken out from Unity's RP core /////
float2 ParallaxOffset1Step(float height, float amplitude, float3 viewDirTS)
{
    height = height * amplitude - amplitude / 2.0;
    float3 v = normalize(viewDirTS);
    v.z += 0.42;
    return height * (v.xy / v.z);
}

Recent Posts

See All
Vertex Wind

Simulating wind using Vertex displacement

 
 
 

Comments


bottom of page