Browse Source

WebGLShadowMap: Support material.map with alphaTest (#25000)

* Support map with alphaTest

* Clean up
WestLangley 2 years ago
parent
commit
7746d10cb4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/webgl/WebGLShadowMap.js

+ 3 - 1
src/renderers/webgl/WebGLShadowMap.js

@@ -244,7 +244,8 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 		if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
 		if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
 			( material.displacementMap && material.displacementScale !== 0 ) ||
 			( material.displacementMap && material.displacementScale !== 0 ) ||
-			( material.alphaMap && material.alphaTest > 0 ) ) {
+			( material.alphaMap && material.alphaTest > 0 ) ||
+			( material.map && material.alphaTest > 0 ) ) {
 
 
 			// in this case we need a unique material instance reflecting the
 			// in this case we need a unique material instance reflecting the
 			// appropriate state
 			// appropriate state
@@ -288,6 +289,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 
 		result.alphaMap = material.alphaMap;
 		result.alphaMap = material.alphaMap;
 		result.alphaTest = material.alphaTest;
 		result.alphaTest = material.alphaTest;
+		result.map = material.map;
 
 
 		result.clipShadows = material.clipShadows;
 		result.clipShadows = material.clipShadows;
 		result.clippingPlanes = material.clippingPlanes;
 		result.clippingPlanes = material.clippingPlanes;