- Home /
accessing bones from fbx in vertex shader
hello, is it possible to access the bones of a skeletal model stored as FBX inside the CG vertex shader?
if so, how?
thanks!
Answer by Bunny83 · Apr 05, 2011 at 07:10 PM
It would be much better if you can tell us for what purpose you need this information? All bones would be a total overkill for a human skeleton. A vertex shader just work on single vertices. You can of course load any parameters you like.
With the Shader class you can load any global parameters:
and with Material object specific:
But be careful, global shader constants will be loaded for all shaders. It would be crazy to load all bone-transform-matrices into the shader.
Well, in that case you would need to set all bone matrices. I don't think that it would be that much faster for low poly models, because you need to update them every frame. In addition you need to pass some kind of skinning information along with each vertex.