It looks like this isin’t supported out-of-the-box. I’ve been trying to work my way through the THREE.js source, and see how to bring ShaderMaterial to SkinnedMesh.
It looks like there are a four vertex ShaderChunks
and zero fragment ShaderChunks available which apparently relate to Shaders. Other chunks may relate, but these are the ones with skin in the name.
THREE.ShaderChunk[ "skinning_pars_vertex" ]
THREE.ShaderChunk[ "skinbase_vertex" ]
THREE.ShaderChunk[ "skinnormal_vertex" ]
THREE.ShaderChunk[ "skinning_vertex" ]
These each have 5-6 matches. Once to be defined, and then once again for basic, lambert, phong, normalMap, depthRGBA (not sure what this last one is).
I presume that by studying the implementation skinning for these other materials, one could bring skinning to ShaderMaterial as well.
Is this accurate? Or are there other blockers that would be encountered?
Thanks
EDIT: oops, still reading. Clearly there’s more to it than this. Please hold..
EDIT2: It looks like it should be possible to add custom fragment shader logic to one of these existing materials. The trick might be uv mapping, as there isin’t any by default. hm.
Closing. Please use the forum if you need more help with custom shader enhancements.
For everyone else who is looking for a basic live example, this one shows a basic setup with the most important shader chunks: https://jsfiddle.net/h02s5n14/4/ (using
three.js R114
).