Three.js / WebGL - transparent planes hiding other planes behind them

前端 未结 6 514
梦毁少年i
梦毁少年i 2020-11-27 17:18

When you have two planes in Three.js / WebGL and one or both of them are transparent, sometimes the plane behind will be hidden by the transparent plane above. Why is this?<

6条回答
  •  时光说笑
    2020-11-27 18:10

    Setting the depthWrite property to false solved my issue.

    new THREE.MeshBasicMaterial({ 
        opacity: 0.25, 
        transparent: true, 
        side: THREE.DoubleSide, 
        depthWrite: false
    });
    

提交回复
热议问题