浏览代码

WebGPURenderer: Apply setupDepth even if fragmentNode isn't null (#28043)

Renaud Rohlinger 1 年之前
父节点
当前提交
9b5d69776d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      examples/jsm/nodes/materials/NodeMaterial.js

+ 2 - 2
examples/jsm/nodes/materials/NodeMaterial.js

@@ -96,9 +96,9 @@ class NodeMaterial extends ShaderMaterial {
 
 		const clippingNode = this.setupClipping( builder );
 
-		if ( this.fragmentNode === null ) {
+		if ( this.depthWrite === true ) this.setupDepth( builder );
 
-			if ( this.depthWrite === true ) this.setupDepth( builder );
+		if ( this.fragmentNode === null ) {
 
 			if ( this.normals === true ) this.setupNormal( builder );