spritefire Posted March 4, 2015 Share Posted March 4, 2015 I've read how to change diffuse textures dynamically on a mesh and have it working on meshes that only use one texture. How do I select a particular material on an exported 3ds max model that has a number of different textures, so that I can change that one texture? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 4, 2015 Share Posted March 4, 2015 mesh.material.subMaterials[1].diffuseTexture = new BABYLON.Texture("./textures/xxx.tga", scene); or mesh.material.diffuseTexture = new BABYLON.Texture("./textures/xxx.tga", scene); Quote Link to comment Share on other sites More sharing options...
spritefire Posted March 4, 2015 Author Share Posted March 4, 2015 ah subMaterials was exactly what I was looking for just for future reference, do you know if its possible to call by the name or can only be called by place in array? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.