Currently OutlineEffect doesn't support SkinnedMesh. The outline shows up, but doesn't follow the animation, just stays at whatever the default pose is. This is now supported with three's own OutlinePass. How tricky would it be to get it working with this library? I'm willing to give it a go if I can get a bit of direction on how to do it. Thanks!
Related three.js links:
https://stackoverflow.com/questions/59786826/best-method-to-get-outline-effect-with-animated-skinned-mesh
https://github.com/mrdoob/three.js/commit/ff77da462dcdd18c2a9c842c9ee82702dc4c2d0d
The OutlineEffect already supports skinned meshes and morph targets since [email protected] https://github.com/vanruesc/postprocessing/issues/68#issuecomment-368229393. If there's a problem with skinning, please provide an example that demonstrates the issue. I don't have a skinned mesh at hand to test with.
I'll have a look into why it's not working for me and report back
So the issue occurs when my selection of meshes contains both Mesh and SkinnedMesh. This isn't such a big deal, but worth noting!
Thanks for digging deeper! Skinning should work even if static and dynamic meshes are selected so this could be a bug. Not sure where it's coming from, though. I'll take a closer look when I have more time. It might also be a good idea to add a skinned mesh to the outline demo for debugging purposes.
I was able to replicate the issue locally with a rigged GLTF model. It looks like three compiles the override materials MeshDepthMaterial and DepthComparisonMaterial once and enables or disables skinning depending on which mesh gets rendered first. If a skinned mesh comes after a non-skinned mesh, the material won't be updated correctly.
| Static selected first | Animated selected first | Static after animated |
|-|-| -|
|
|
| 
Weird things happen when non-skinned meshes are selected after the override material was compiled for skinned meshes: the outline is then all over the place because of missing animation data.
There's a good chance that this is a known issue and there might be no simple solution. I'll check later if there's already a ticket for this problem over at three. If there is none yet, I'll prepare a simple reproduction of the bug with override materials.
As I thought, this is a known issue: https://github.com/mrdoob/three.js/issues/18533 and https://github.com/mrdoob/three.js/issues/14577 seem to be the relevant discussions.
The current behaviour of three's override material system also affects SSAO which uses a MeshNormalMaterial as an override material via the NormalPass. Furthermore, the other effects in this library - even the SelectiveBloomEffect - are unaffected because they don't use override materials.
I can confirm, that SSAOEffect does not work with SkinnedMesh.
Is there any fix for this?
Is there any fix for this?
Not that I'm aware of. This issue also puts a damper on #190.
A workaround for override materials with instanced and skinned meshes has been added in [email protected]. Check this to find out how it can be used.
Most helpful comment
As I thought, this is a known issue: https://github.com/mrdoob/three.js/issues/18533 and https://github.com/mrdoob/three.js/issues/14577 seem to be the relevant discussions.
The current behaviour of three's override material system also affects SSAO which uses a
MeshNormalMaterialas an override material via theNormalPass. Furthermore, the other effects in this library - even theSelectiveBloomEffect- are unaffected because they don't use override materials.