BMWPilote Posted July 16, 2018 Share Posted July 16, 2018 Every AbstractMesh holds a BoundingInfo and the BoundingInfo consumes too much memory. The internal bounding box holds a lot of vectors. So if we have a quite big scene, let's say 100 000 meshes, only the bounding boxes consume hundreds of mega bytes...I have'v count other stuff yet but comparing to pure vertex buffer + index buffer, the overhead is really heavy. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2018 Share Posted July 16, 2018 Well this is expected no? We try to keep only necessary data and have every thing else lazy loaded. The bounding infos for instance are mandatory to do the frustum clipping. You can consider setting the bounding info to null and then mark all meshes as mesh.alwaysSelectAsActiveMesh = true Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2018 Share Posted July 16, 2018 Anyway if you have 100000 meshes I'm not sure memory will be your main issue:) Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2018 Share Posted July 16, 2018 Also for the vectors hold by the bounding info: it is always a trade-off between performance and memory. So the bounding info keeps some vectors to avoid computing everything on every call which will kill performance Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2018 Share Posted July 16, 2018 A bounding info should contains 20 vector3 (approximately) So 20x3x4 bytes 120 bytes So for 100000 meshes it will be 12mb. Nothing compared to the memory sized used by mesh or texture data. If you want to save large chunk of memory I encourage you reading this: http://doc.babylonjs.com/how_to/reduce_memory_footprint JackFalcon and DylanD 2 Quote Link to comment Share on other sites More sharing options...
BMWPilote Posted July 16, 2018 Author Share Posted July 16, 2018 2 hours ago, Deltakosh said: A bounding info should contains 20 vector3 (approximately) So 20x3x4 bytes 120 bytes So for 100000 meshes it will be 12mb. Nothing compared to the memory sized used by mesh or texture data. If you want to save large chunk of memory I encourage you reading this: http://doc.babylonjs.com/how_to/reduce_memory_footprint OK Thank you big boss. But in my case, I need to handle picking, so that I cannot clear the buffers on CPU side. And enableOfflineSupport does not work for custom format right? Is there anyway to do paging in the world of Web? Hum for rendering I hacked the class Scene an I am doing progressive rendering so it is not a problem. My only problem is memory now... Loading big models crashes the browser. I would like to collect ideas here and there so that I can know what to do in the next sprints... I know another possibility is doing on demand loading and unloading but it would be my last choice. I have one scene which contains more than 70 000 000 triangles... Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 16, 2018 Share Posted July 16, 2018 ezpz just don't have a scene with 70 000 000 triangles Haha just kidding, good luck! Quote Link to comment Share on other sites More sharing options...
jerome Posted July 16, 2018 Share Posted July 16, 2018 70 millions triangles !!!! Do you have at least 70 millions pixels in your screen ? It's not a joke ... but an advice : try to manage only what is visible in the screen. JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted July 16, 2018 Share Posted July 16, 2018 70 millions triangles + 100 000 meshes + picking enable on all meshes = very few solutions to limit lag. Some ideas off the cuff: reduce your polycount freeze all meshes & materials, and use UI to interact with objects (allowing to freeze/unfreeze on the fly) divide your scene into multiple scenes having last most powerful GPU & CPU & a browser without any plugins JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 16, 2018 Share Posted July 16, 2018 Yes, ask all users to have the latest graphics card and a latest-generation I7 processor. 100 000 mailles is really huge. I do not even know how to add so many objects to a scene, it must be a sacred work to achieve. Very very long. I do not even imagine how many images there are to load. To add 1000 meshes already on a scene is already enormous provided to have instances to create otherwise the FPS are really low and the users will not really be able to benefit from your game and will leave after 2 minutes of use. The Leftover 1 Quote Link to comment Share on other sites More sharing options...
BMWPilote Posted July 17, 2018 Author Share Posted July 17, 2018 Just a question about the memory limit of the browser, e.g. Chrome, is it 2GB or 4GB? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 chrome is a 64bit process so the limit is really high. The problem will be GPU memory Quote Link to comment Share on other sites More sharing options...
BMWPilote Posted July 18, 2018 Author Share Posted July 18, 2018 9 hours ago, Deltakosh said: chrome is a 64bit process so the limit is really high. The problem will be GPU memory My problem is that I have a computer which has 16GB RAM and 4GB GPU RAM. But when the above one consumes more than around 2G, it crashes. But if we look at the Task Manager on Windows, chrome consumes already 7GB memory. So I am really confused... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 18, 2018 Share Posted July 18, 2018 You use something in 32 bit for not that it exceeds 2 GB. The 32 bit does not manage more than 2 GB. May be a track to explore. Quote Link to comment Share on other sites More sharing options...
BMWPilote Posted July 18, 2018 Author Share Posted July 18, 2018 3 hours ago, Dad72 said: You use something in 32 bit for not that it exceeds 2 GB. The 32 bit does not manage more than 2 GB. May be a track to explore. Could you please give me more ideas? I know that my chrome is indeed 64 bit. What else could be 32 bit? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 18, 2018 Share Posted July 18, 2018 I can not really know it for you, I do not know what you have on your computer and what you use. I suppose because usually if something does not exceed 2 GB of memory is because of the 32 bit. But it may be something else. Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted July 19, 2018 Share Posted July 19, 2018 Also in optimization phase and ran across this simultaneously... https://blog.raananweber.com/2015/09/03/scene-optimization-in-babylon-js/ friend @RaananW says crystal clear: Quote Too many or high quality meshes can cause your scene to render very slowly, especially on computers without a strong GPU. Let's see what can be done to solve those issues. So hooray, bird on topic (marks on calendar) : ) Hit jRad with the similar question about a year back, on run-time vertex editing utility.... @BMWPilote Maybe that helps you. Are Instances applicable? https://doc.babylonjs.com/how_to/how_to_use_instances Or LOD?: https://doc.babylonjs.com/how_to/how_to_use_lod https://doc.babylonjs.com/how_to/in-browser_mesh_simplification cheers! 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.