Hagop Posted October 15, 2016 Share Posted October 15, 2016 Hi all It seems to me that Babylon.js does not cater for submaterials disposal. The following code disposes meshes and materials but not submaterials for (var i=0; i< somearray.length; i++) { var mesh = somearray ; if (mesh.material) { if (mesh.material.subMaterials) { for (var z=0; z < mesh.material.subMaterials.length; z++) { var getsubMaterials = mesh.material.subMaterials[z]; mesh.material.subMaterials[z].dispose(false,true); } } mesh.material.dispose(false,true); //scene.resetCachedMaterial(); } mesh.dispose(); } Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 17, 2016 Share Posted October 17, 2016 Hey where did you find this code? Quote Link to comment Share on other sites More sharing options...
Hagop Posted October 22, 2016 Author Share Posted October 22, 2016 This is my code it is not source code Quote Link to comment Share on other sites More sharing options...
Nabroski Posted October 24, 2016 Share Posted October 24, 2016 you are looking for help. make a playground GameMonetize 1 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.