提交 72afe269 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #12036 from fernandojsg/alphaCut

GLTF Added alphaCutoff support in exporter and loader
......@@ -555,7 +555,13 @@ THREE.GLTFExporter.prototype = {
// alphaMode
if ( material.transparent ) {
gltfMaterial.alphaMode = 'BLEND'; // @FIXME We should detect MASK or BLEND
gltfMaterial.alphaMode = 'MASK'; // @FIXME We should detect MASK or BLEND
if ( material.alphaTest !== 0.5 ) {
gltfMaterial.alphaCutoff = material.alphaTest;
}
}
......
......@@ -1603,6 +1603,12 @@ THREE.GLTFLoader = ( function () {
materialParams.transparent = true;
if ( alphaMode === ALPHA_MODES.MASK ) {
materialParams.alphaTest = material.alphaCutoff || 0.5;
}
} else {
materialParams.transparent = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册