Issue: Morph Targets unexpectedly change shading

Hi there,

I have created a scalable box with morphtargets for dimensions x,y and z in Blender 2.93. However, when I load the .glb in three.js, shading looks different than I expected.


Cube.glb (4.2 KB)

I think it may be related with the box being scaled to (0,0,0). Does anyone know how to restore the shading?

Thanks,
Tim

(the issue is reproducable in @donmccurdy 's gltf viewer as demonstrated in the video below)

Can you also share the morphed cube? The currently shared assets has no morph definitions at all.

Hi @Mugen87,

sorry, wrong file. This is the correct one:
Cube.glb (4.2 KB)

The morph normals are all zero which is definitely wrong input. Besides, the animation clip has a duration of 0.125 which also does not look right to me.

BabylonJS does not display the file correctly, too: https://sandbox.babylonjs.com/

So this is not a three.js issue. Something wrong happens when you author and export the asset in Blender.

Hi @Mugen87,

thanks for your quick response. Do you maybe know a way to fix the morph normals after the morph target influences have been set?

Thanks,
Tim

I have created a new test model with an extra morphtarget that counteracts on all the other morphtargets. Also I have removed the animation.

When the new model is loaded, shading is displayed as expected. When the ‘counterActXYZ’ morphtarget is manipulated, the shading turns to flat white. The same effect is visible in the Babylon viewer.


Cube.003.glb (7.2 KB)