Hi,
the parallax mapping looks quite wrong. I investigated the code (i mean trial and error :D)
and found out with a small fix, it looks much better
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;
// the fix
viewDirT.y *= -1.0;
viewDirT.z += 0.42;
dUvOffset = height * (viewDirT.xy / viewDirT.z);
}
I’m not hundred percent sure, if this is the right fix.
There could also be an issue with tangent calculation.
Left broken, right Fixed
There is also a small demo, in movement its much more clear.
https://playcanvas.com/editor/scene/548876
fix-parallax.js
I can prepare a fix PR on github, if you agree that it helps