OMAR Posted April 3, 2016 Share Posted April 3, 2016 Hi guys, does anybody here know whether Babylon.js supports material instancing or not? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 3, 2016 Share Posted April 3, 2016 What do yo mean by material instancing? We support mesh instancing and material sharing between meshes Quote Link to comment Share on other sites More sharing options...
OMAR Posted April 3, 2016 Author Share Posted April 3, 2016 It's like creating "instances" of a material which might have different properties. For example there is Material A which has emissiveColor of Blue and Material B is an instance of Material A that has an emissiveColor of Red. But of course since Material B is an instance of Material A, applying diffuseColor to Material A will influence Material B as well, but Material B can have its own properties set for diffuseColor. Basically the whole idea is to have instances of materials in the scene which have different properties set to them making scene look really colorful while keeping the number of drawCalls same. I mean I don't even know whether it's possible in theory or not, maybe I went full mad scientist here sigh Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 3, 2016 Share Posted April 3, 2016 A.material = B.material.clone('newMat'); A.material.differentsettings =? an instance would not work, you would have to clone it. 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.