Switch from UV textured material to MeshNormalMaterial at runtime not working?[SOLVED]

A Mesh is loaded from file. Mesh shows up with a UV mapped PNG on it and animates well. So far OK.

On machines where FPS falls below 15 FPS I want to switch the mesh material to MeshNormalMaterial.
Below is what I tried to change the Mesh Material at runtime but instead it keeps displaying the original UV mapped PNG as if material had not changed?

mesh.material = new MeshNormalMaterial();
mesh.material.needsUpdate = true;

Hi!
Shouldn’t it be new THREE.MeshNormalMaterial()?

1 Like

Why would you want to use a MeshNormalMaterial?

It was a timing issue.
The code could be called before some Mesh had finished loading…
Making sure the 2 lines are only called on completely loaded Meshes fixed things.
How can I close the topic?

You can add a [SOLVED] in the title if you want.

3 Likes