SkinnedMesh + ShaderMaterial

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?


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.

Author: Fantashit

1 thought on “SkinnedMesh + ShaderMaterial

Comments are closed.