How do I get animation transforms into my vertex shader?

I have a simple custom shader with a custom vertex and fragment shader for some custom lighting. However when I use the shader on a model that is animated by a Animation component, the animations don’t play. I’m guessing because the vertex shader does not include animatoin transforms:

vec4 view = matrix_view * matrix_model * vec4(aPosition, 1.0);
gl_Position = matrix_projection * view;

Any pointers?

I solved his by copying code out of the pc.shaderChunks object and putting it into my shader at run time. Some code has to be dynamically added based on some bone texture mapping stuff and it’s kind of a pain but works out.

1 Like