spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.14k stars 381 forks source link

Updating MeshLineMaterials opacity #36

Closed adamjamescuz closed 7 years ago

adamjamescuz commented 7 years ago

Is it possible to update the mesh line material's opacity after it has been created? (e.g in an animation). I can set the opacity at the start using the the transparent:true and the opacity params as you describe but if I try to update the opacity at a later time using either meshlinematerial.opacity = whatever, or mesh.material.opacity neither of these work.

spite commented 7 years ago

Good catch, I'm not mirroring the values from the material wrapper into the shader.

For now, you can update the opacity -and other values- with the material uniforms directly: lineMesh.material.uniforms.opacity.value = whatever

adamjamescuz commented 7 years ago

Great, thank you