Chrome: Visual glitch when baking and nulling mesh skeleton

Hi everyone,

Check this out

Only happens in Chrome (or Electron)!

FYI:

Windows 10
Firefox²
Google Chrome³
Electron³

²no glitch
³glitch

Best wishes
Joe

P.S. Oh snap, I forgot. Model is CC0 by Quaternius • Ultimate Modular Men Pack. Sorry!

This happens because when you bake the transformations into the vertices / remove the skeleton, a new effect has to be created for the mesh and this effect takes a few frames to be ready, so in the meantime the mesh will be displayed with the baked data and with the previous effect, hence these artifacts.

Apart from disabling parallel shader compiling (engine.getCaps().parallelShaderCompile = false;), I don’t see how to solve the problem…

[…] In fact, you can fix the problem by making sure the effect you will need when you remove the skeleton is already created and ready. You can do this by removing the skeleton just after loading the gltf file and waiting for the scene to be ready => the effect “without the skeleton” will have been created and will be ready. Then set the skeleton property back and do as usual:

As things are always more complicated than expected, you will also need this PR to make the PG work:

2 Likes

Ah, I see. This explains why Firefox works: it has parallel shader compilation turned off.

Anyway, thanks for the quick fix :slight_smile: