Create new Standard Material on the fly #234
-
|
How do it create a new standard material when my model is loaded and apply to its meshes. The only examples i can find have a material already existing in the scene, but i need to create a new material when i need to |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Got it: import { StandardMaterial } from '@babylonjs/core'; |
Beta Was this translation helpful? Give feedback.
-
|
That works. You can also use a ref - like: declarativly you could as well: One advantage of above methods is that the material will likely be "ready" and loaded when the model is loaded, so not async waiting to apply the material. |
Beta Was this translation helpful? Give feedback.
Got it:
import { StandardMaterial } from '@babylonjs/core';
var testMat=new StandardMaterial("",scene);