VRM Pose Demo in documentation has a bug

Documentation Page: Babylon.js and VRM | Babylon.js Documentation

In the second playground example: https://playground.babylonjs.com/#K5W35Y#8 the model appears to have no face, or it is positioned somewhere away from the body. Moving the UI sliders seems to move the face up and down instead of morphing expressions.

A search of this forum before I posted this issue found that this seems to have happened before and looks like it might have been fixed at some point: Broken MorphTarget in VRM(glb) Model so perhaps this is a regression?

@bghgary @il-m-yamagishi

In v4.2.0, it works properly. there may be some regression in v5.0.0-dev. @Deltakosh

1 Like

Can you have a look and maybe find a repro? I will be happy to fix it

@Deltakosh I think this from above is the repro: https://playground.babylonjs.com/#K5W35Y#8

Works in 4.2 but broken in 5.0

@Evgeni_Popov can you check for me if by setting the morphtarget to the old mode(isUsingTExtureForTarget = false) it works?

Yes, setting _useTextureToStoreTargets = false in the MorphTargetManager class makes it work.

Note that the PG generated:

@il-m-yamagishi do you mind creating a repro with your code in the pg? I cannot debug from your minified loader ;(

If you are creating your own shader of some sorts, you need to declare two new uniforms like here:
Babylon.js/standardMaterial.ts at master · BabylonJS/Babylon.js (github.com)

Ok found it!
you need to add public MORPHTARGETS_TEXTURE = false; here:
babylon-mtoon-material/mtoon-material-defines.ts at master · virtual-cast/babylon-mtoon-material (github.com)

Like here: Babylon.js/standardMaterial.ts at master · BabylonJS/Babylon.js (github.com)

and you need to declare all the morph related uniforms here:
babylon-mtoon-material/mtoon-material.ts at master · virtual-cast/babylon-mtoon-material (github.com)

like there:
Babylon.js/standardMaterial.ts at master · BabylonJS/Babylon.js (github.com)

And also add the sampler now:
Babylon.js/standardMaterial.ts at master · BabylonJS/Babylon.js (github.com)

Actually I went ahead and did a PR :slight_smile:
Fix morph target to support mnew texture mode by deltakosh · Pull Request #50 · virtual-cast/babylon-mtoon-material (github.com)


Thank you very much for PR!

I will check out this fix has compatibility with 4.2.x and 5.0.0-dev, also check to exist other breaking changes in StandardMaterial.

1 Like