Skip to content

Commit

Permalink
update sampler textures
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed May 3, 2024
1 parent f2766a0 commit 23e026c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/jsm/renderers/common/Bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class Bindings extends DataMap {

}

} else if ( binding.isSampler ) {

binding.update();

} else if ( binding.isSampledTexture ) {

const texture = binding.texture;
Expand Down
10 changes: 10 additions & 0 deletions examples/jsm/renderers/common/nodes/NodeSampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ class NodeSampler extends Sampler {

}

update() {

if ( this.texture !== this.textureNode.value ) {

this.texture = this.textureNode.value;

}

}

}

export default NodeSampler;

0 comments on commit 23e026c

Please sign in to comment.