FBX animation don't work with custom shader

Hi again :c

I’m having a trouble with my custom shader. If I enable the custom shader the animation doesn’t work. If I disable it the animation works.

Need I to implement some calculation of external animation or skeleton in my custom shader? I don’t know.

I’m using FBX Loader and THREE.AnimationMixer() to animations.

If you are using ShaderMaterial or RawShaderMaterial, you essentially tell WebGLRenderer that you want to use your own shaders. So you have to add the respective shader code for vertex blending or morphing, otherwise it is not possible to use animations with a custom materials.

Take a look at this example to see how you could change a built in material while still keeping skinning and morph target animation.


Are there more links to learn about it? 'Cause now I know about attributes, uniforms etc but it’s still confusing how I should to apply the calculations.

I created a uniform float, I passed a float value for him, but how I should set it on vertexShader calculation?

I’ve tried this:


     attribute vec3 morphTarget0;
     morphed += (morphTarget0 - position) * eyeLeft;

gl_Position += vec4(morphed,1.);