浏览代码

WebGPURenderer: Add `aoNode` to NodeMaterial (#28061)

* add aoNode

* try CI
Renaud Rohlinger 1 年之前
父节点
当前提交
03da0881ec
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      examples/jsm/nodes/materials/NodeMaterial.js
  2. 二进制
      examples/screenshots/webgl_loader_gltf_dispersion.jpg

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

@@ -46,6 +46,7 @@ class NodeMaterial extends ShaderMaterial {
 
 		this.lightsNode = null;
 		this.envNode = null;
+		this.aoNode = null;
 
 		this.colorNode = null;
 		this.normalNode = null;
@@ -337,9 +338,11 @@ class NodeMaterial extends ShaderMaterial {
 
 		}
 
-		if ( builder.material.aoMap ) {
+		if ( this.aoNode !== null || builder.material.aoMap ) {
 
-			materialLightsNode.push( new AONode( texture( builder.material.aoMap ) ) );
+			const aoNode = this.aoNode !== null ? this.aoNode : texture( builder.material.aoMap );
+
+			materialLightsNode.push( new AONode( aoNode ) );
 
 		}
 

二进制
examples/screenshots/webgl_loader_gltf_dispersion.jpg