소스 검색

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. BIN
      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 ) );
 
 		}
 

BIN
examples/screenshots/webgl_loader_gltf_dispersion.jpg