Skip to content

Commit 5a6c9e1

Browse files
aardgooseaardgoose
andauthored
WebGPURenderer: update sampler bindings on texture change (#28268)
* update sampler textures * simplyfy --------- Co-authored-by: aardgoose <angus.sawyer@email.com>
1 parent 494173b commit 5a6c9e1

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

examples/jsm/renderers/common/Bindings.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ class Bindings extends DataMap {
122122

123123
}
124124

125+
} else if ( binding.isSampler ) {
126+
127+
binding.update();
128+
125129
} else if ( binding.isSampledTexture ) {
126130

127131
const texture = binding.texture;

examples/jsm/renderers/common/nodes/NodeSampler.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ class NodeSampler extends Sampler {
1010

1111
}
1212

13+
update() {
14+
15+
this.texture = this.textureNode.value;
16+
17+
}
18+
1319
}
1420

1521
export default NodeSampler;

0 commit comments

Comments
 (0)