@sunag Sir, help plz~~!
I have a custom node material like:
class CustomMaterial extends MeshStandardNodeMaterial {
constructor(parameters = {}) {
const {diffuseMap, params} = parameters;
super(params);
this.type = 'CustomMaterial';
this.diffuseMap = uniform(new TextureLoader().load(’a.jpg')));
this.colorNode = texture(this.diffuseMap.value, vec2(_uvx, _uvy));
}
}
when start up with material = new CustomMateril()
,it works. However, I want to dynamic modify the texture ( or other uniforms ) like
material.diffuseMap.value = texture;
material.needsUpdate = true;
material.uniformsNeedUpdate = true;
but none of above works.
What should I do, how should I dynamic modify the uniforms correctly? For example, how to add a get texture() {}
function or something like that.