我想在其他所有内容上渲染一个网格,这个解决方案工作得很好:Three.js - Geometry on top of another
我想知道是否同样可以实现与网格。renderDepth,但是到目前为止我还不能使它工作。似乎renderDepth只有在material.depthTest或depthWrite设置为false时才有效果,但在同一对象中深度排序当然是错误的:http://jsfiddle.net/SF9tX/22/
var cube = new THREE.Mesh(geometry, material);
cube.renderDepth = 1;
scene.add(cube);
var cube2 = new THREE.Mesh(geometry, material);
cube2.position.x = 1;
cube2.renderDepth = 2;
scene.add(cube2);
// with any one of these lines the renderDepth has an effect
// but then of course the depth test/write is wrong within the same object
// material.depthWrite = false;
// material.depthTest = false;
对于r70是renderDept函数被删除。https://github.com/mrdoob/three.js/issues/5496