UNPKG

@animech-public/playcanvas

Version:
14 lines (12 loc) 392 B
var parallaxPS = ` uniform float material_heightMapFactor; void getParallax() { float parallaxScale = material_heightMapFactor; float height = texture2DBias($SAMPLER, $UV, textureBias).$CH; height = height * parallaxScale - parallaxScale*0.5; vec3 viewDirT = dViewDirW * dTBN; viewDirT.z += 0.42; dUvOffset = height * (viewDirT.xy / viewDirT.z); } `; export { parallaxPS as default };