Kesshi Posted May 18, 2017 Share Posted May 18, 2017 Hi, currently i have a memory issue in my app. I have a scene with many clones of some high poly meshes. So far its running fine on mobile devices but as soon as i start picking arround in the scene the memory keeps increasing until the app crashes. The reason seems to be the position array cache of the meshes. (here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.ts#L1399 ) Each mesh holds its own instance of the position array. Even if all meshes share the same geometry. @Deltakosh I think this cache should be moved to the geometry class. This way the array could be shared between meshes. What do you think? Quote Link to comment Share on other sites More sharing options...
Gijs Posted May 18, 2017 Share Posted May 18, 2017 Can't you use instanced meshes instead of clones? Quote Link to comment Share on other sites More sharing options...
Kesshi Posted May 18, 2017 Author Share Posted May 18, 2017 8 minutes ago, Gijs said: Can't you use instanced meshes instead of clones? No. I need to be able to use different materials for each mesh. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted May 22, 2017 Author Share Posted May 22, 2017 @Deltakosh Did you had time to look at this? I could also try to create a PR if you think its ok. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 22, 2017 Share Posted May 22, 2017 A single copy makes sense. Geometry is not the greatest fit, since this data is not going to GPU. If you refactor, you will also need to change AbstractMesh & InstancedMesh. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 23, 2017 Share Posted May 23, 2017 I would like a PR if you don't mind Quote Link to comment Share on other sites More sharing options...
Kesshi Posted May 24, 2017 Author Share Posted May 24, 2017 ok i put in on my todo list for the next days. Sebavan 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.