@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
14 lines (12 loc) • 392 B
JavaScript
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 };