소스 검색

ShadowMaskModel: Fix signatures. (#30764)

* ShadowMaskModel: Fix signatures.

* ShadowMaskModel: Use `mulAssign()`.

* ShadowNodeMaterial: Fix transparent.
Michael Herzog 9 달 전
부모
커밋
6b28459bc2
2개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 0
      src/materials/nodes/ShadowNodeMaterial.js
  2. 4 4
      src/nodes/functions/ShadowMaskModel.js

+ 9 - 0
src/materials/nodes/ShadowNodeMaterial.js

@@ -45,6 +45,15 @@ class ShadowNodeMaterial extends NodeMaterial {
 		 */
 		this.lights = true;
 
+		/**
+		 * Overwritten since shadow materials are transparent
+		 * by default.
+		 *
+		 * @type {boolean}
+		 * @default true
+		 */
+		this.transparent = true;
+
 		this.setDefaultValues( _defaultValues );
 
 		this.setValues( parameters );

+ 4 - 4
src/nodes/functions/ShadowMaskModel.js

@@ -30,18 +30,18 @@ class ShadowMaskModel extends LightingModel {
 	 *
 	 * @param {Object} input - The input data.
 	 */
-	direct( { shadowMask } ) {
+	direct( { lightNode } ) {
 
-		this.shadowNode.mulAssign( shadowMask );
+		this.shadowNode.mulAssign( lightNode.shadowNode );
 
 	}
 
 	/**
 	 * Uses the shadow mask to produce the final color.
 	 *
-	 * @param {ContextNode} context - The current node context.
+	 * @param {NodeBuilder} builder - The current node builder.
 	 */
-	finish( context ) {
+	finish( { context } ) {
 
 		diffuseColor.a.mulAssign( this.shadowNode.oneMinus() );
 

粤ICP备19079148号