2017-05-08 39 views

回答

1

當澆鑄three.js所陰影,網格從視光的點視爲固體。

但是,如果你的網具有透明質感,或α-地圖,可以通過網格指定CustomDepthMaterial實現適當的陰影。

有幾種方法可以做到這一點。一種方法是通過自定義ShaderMaterialthis three.js example中有這種方法的一個例子。

Screenshot of three.js cloth animation example

對於比較簡單的場景,它足以使用這個模式:

var customDepthMaterial = new THREE.MeshDepthMaterial({ 

    depthPacking: THREE.RGBADepthPacking, 

    map: myTexture, // or, alphaMap: myAlphaMap 

    alphaTest: 0.5 

}); 

mesh.customDepthMaterial = customDepthMaterial; 

three.js所r.85

+0

歡迎SO。請記住點擊複選標記以「接受」答案。謝謝。 – WestLangley