felixmariotto / three-mesh-ui

⏹ Make VR user interfaces for Three.js
https://felixmariotto.github.io/three-mesh-ui/#basic_setup
MIT License
1.26k stars 134 forks source link

Add Custom material #259

Closed abren93 closed 11 months ago

abren93 commented 1 year ago

I'm trying to overwrite the material like this:

const contentContainer = new ThreeMeshUI.Block({...});
contentContainer.backgroundMaterial = myShaderMaterial;
contentContainer.backgroundMaterial.needsUpdate = true;
contentContainer.updateBackgroundMaterial();
contentContainer.update();
ThreeMeshUI.update();

Doesn't work. How can I overwrite the material? Thank you