Переглянути джерело

GLTFExporter: Avoid writing default alphaCutoff.

Don McCurdy 7 роки тому
батько
коміт
727ce2e932
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      examples/js/exporters/GLTFExporter.js

+ 2 - 1
examples/js/exporters/GLTFExporter.js

@@ -600,7 +600,8 @@ THREE.GLTFExporter.prototype = {
 
 				gltfMaterial.alphaMode = material.opacity < 1.0 ? 'BLEND' : 'MASK';
 
-				if ( material.alphaTest > 0.0 ) {
+				// Write alphaCutoff if it's non-zero and different from the default (0.5).
+				if ( material.alphaTest > 0.0 && material.alphaTest !== 0.5 ) {
 
 					gltfMaterial.alphaCutoff = material.alphaTest;