attribute vec3 aVertexPosition; attribute vec3 aVertexNormal; attribute vec3 aVertexNormalOld; attribute vec3 aVertexPositionOld; uniform mat4 prMvMatrix; uniform mat3 normMatrix; uniform vec3 directLightDir; uniform float morphingState; varying float vLightWeight; void main(void) { vLightWeight = max(dot(normMatrix * mix(aVertexNormalOld, aVertexNormal, morphingState), directLightDir), 0.0); gl_Position = prMvMatrix* vec4(mix(aVertexPositionOld,aVertexPosition,morphingState),1.0); }