Adding Babylonx shader removes animation

I’m trying to fix a smoothing issue I have with my model that is animated with bones. So I found a nice shader script from NasimiAsl that could fix this problem. See below. (I don’t really understand it. But he sais it works :wink: Can’t check the playground however because the babylonx.js is not loading.
The issue that I encounter now is that when I apply the shader all animations are immediately removed.
Does anyone have some experience with this?

mesh.material = new BABYLONX.ShaderBuilder()
		.Light({phonge:1.5,direction:'vec3(100.)',normal:BABYLONX.Normals.Flat})
        .InLine('float l1 = length(result.xyz);')
		.Map({ path:'/textures/ground.jpg' })
		.InLine('result = vec4(result.xyz*max(.2,l1),1.);')
		.BuildMaterial(scene);

Bone animations are performed in the gpu by the vertex shader. You might try forcing this to be done on the cpu. Think the setting done in mesh, since vertex data is changed.

yes, thank you!
I found:
mesh.computeBonesUsingShaders = false;
that works!
:slight_smile:

1 Like