Precompile Morph Target shaders

Hello.

Let me explain my situation first.

Right now I’m trying to run an average 4 minute animation with babylon.js and this animation typically has around 15 morph target bindings.
And i use a skinned mesh with about 100 morph targets

The problem is that when the morph target is compiled during the animation run, resulting in flickering and frame drop.

morphTargetManager.optimizeInfluencers = false;
I know it’s possible to fix it with this option, but if it’s like this, it’s not good for performance and it had a problem with 100 targets being rendered strangely on mobile.

So the solution I thought of is to compile a morph target manually before animation play. If I scan animation data from beginning to end, it is possible to calculate the maximum number of morph targets used at one point.

We have an issue to track this problem:

2 Likes

Thank you for your answer. I’m looking forward to improvement