فهرست منبع

WebGPURenderer: update sampler bindings on texture change (#28268)

* update sampler textures

* simplyfy

---------

Co-authored-by: aardgoose <[email protected]>
aardgoose 1 سال پیش
والد
کامیت
5a6c9e1674
2فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 4 0
      examples/jsm/renderers/common/Bindings.js
  2. 6 0
      examples/jsm/renderers/common/nodes/NodeSampler.js

+ 4 - 0
examples/jsm/renderers/common/Bindings.js

@@ -122,6 +122,10 @@ class Bindings extends DataMap {
 
 				}
 
+			} else if ( binding.isSampler ) {
+
+				binding.update();
+
 			} else if ( binding.isSampledTexture ) {
 
 				const texture = binding.texture;

+ 6 - 0
examples/jsm/renderers/common/nodes/NodeSampler.js

@@ -10,6 +10,12 @@ class NodeSampler extends Sampler {
 
 	}
 
+	update() {
+
+		this.texture = this.textureNode.value;
+
+	}
+
 }
 
 export default NodeSampler;