Parallax map shader error

was away from my current project since last tuesday, returned to get an error msg:

Failed to compile fragment shader:

ERROR: 0:446: ‘texture_heightMap’ : undeclared identifier
ERROR: 0:446: ‘texture’ : no matching overloaded function found
ERROR: 0:446: ‘r’ : field selection requires structure, vector, or interface block on left hand side

441: uniform float material_heightMapFactor;
442:
443: void getParallax() {
444: float parallaxScale = material_heightMapFactor;
445:
446: float height = texture2DBias(texture_heightMap, vUv0, textureBias).r;
447: height = height * parallaxScale - parallaxScale*0.5;
448: vec3 viewDirT = dViewDirW * dTBN;
449:
450: viewDirT.z += 0.42;
451: dUvOffset = height * (viewDirT.xy / viewDirT.z);
while rendering Pass:RenderPassForward RT:WebglFramebuffer | Camera: Camera, Layer: World(OPAQUE) | Node: Box, Material: New Material

[object Object]

any object with a material using parallax gives the error while they also disappear in the editor. i was able to easily reproduce it here:

https://playcanvas.com/project/1334528/overview/parallaxerror

maybe on my hardware or browser:

nvidia geforce rtx 2080 super
chrome version 134.0.6998.166

1 Like

I’ll check it out last week.
By the way, try with a previous version (in Settings) to see if that helps.

2 Likes

tried that already. doesn’t help :frowning:

oh. it actually does.

but there’s another thing. when i switch the engine version it works in playmode. parallax is back, using previous version.

but it doesn’t update in the editor. and if i reload it stays with the current version. that is kinda unexpected.

1 Like

The Editor itself is on a fixed version, only your project in the launcher or when published uses your selected version.

1 Like

ok … but from an ux perspective i seems unexpected, to me at least. maybe an explanatory sentence next to the pulldown would help.

It’s mentioned here, but easy to miss I suspect.

By the way, what are you using parallax shader for? It was pretty much not working correctly for a long time … I even started to upgrade to a lot newer implementation, but have not finished it yet.

1 Like

oh … i definitly missed it.

as for the shader. i never really understood it tbh. i thought it was supposed to be a heightmap or additional bump in the first place. it never did what i expected it would. still. if you use a decent map you can create interesting distorsions especially when transforming the xy coordinates in a loop.

but tell me when you have fixed it. will be interesting to see what it does then :wink: