Add r_parallaxMapOffset.

This commit is contained in:
James Canete 2021-07-05 21:59:20 -07:00
parent 66cb20a7f3
commit 69ec389335
5 changed files with 14 additions and 0 deletions

View file

@ -89,6 +89,9 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
// current size of search window
float size = 1.0 / float(linearSearchSteps);
// adjust position if offset above surface
dp -= ds * r_parallaxMapOffset;
// current depth position
float depth = 0.0;
@ -142,6 +145,7 @@ float RayIntersectDisplaceMap(vec2 dp, vec2 ds, sampler2D normalMap)
#endif
return bestDepth;
return bestDepth - r_parallaxMapOffset;
}
float LightRay(vec2 dp, vec2 ds, sampler2D normalMap)