2017-05-08 2 views

답변

1

그림자를 three.js로 캐스팅 할 때 메쉬는 빛의 관점에서 보면 단색으로 처리됩니다.

그러나 메쉬에 투명한 텍스처 또는 알파 맵이있는 경우 메쉬에 CustomDepthMaterial을 지정하여 적절한 그림자를 얻을 수 있습니다.

여러 가지 방법이 있습니다. 한 가지 방법은 맞춤 ShaderMaterial입니다. this three.js 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에 :

Screenshot of three.js cloth animation example

간단 장면의 경우,이 패턴을 사용하기에 충분하다. 체크 표시를 클릭하여 답변을 수락하는 것을 잊지 마십시오. 고맙습니다. – WestLangley

관련 문제