cetinDev
cetinDev

Reputation: 319

ThreeJS hide texture

How can i hide texture on threejs objects? I could not find anywhere. I don't want to remove texture. is it possible ?

const texture = new THREE.Texture(this.setTexture(properties));
 object.material = new THREE.MeshPhongMaterial({
          map:texture,
          color,
          side: THREE.DoubleSide,
          shininess: 30,
          flatShading: THREE.FlatShading,
          transparent: false,
          opacity: Number(opacity)
      });

Upvotes: 0

Views: 966

Answers (1)

Mugen87
Mugen87

Reputation: 31026

No, it's not possible to hide a texture or make it invisible. You have to remove the texture from the material like so:

object.material.map = null; 
object.material.needsUpdate = true;

three.js R110

Upvotes: 2

Related Questions