Nastro Posted June 21, 2016 Share Posted June 21, 2016 Hi ! I have a question again I use my babylon on my smartphone (Iphone 6) and i see a big battery consuming... during 10 minutes, i loose 10-15% of battery when i display a simple view with a lot of meshes... I can't show you an example because it's a commercial project :/, if someone have any ideas.. Thanks a lot Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted June 21, 2016 Share Posted June 21, 2016 What are the specs if the scene, like polycount, drawcalls number, textures size, etc ? Have you decent number of FPS ? Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 21, 2016 Author Share Posted June 21, 2016 On my Iphone 6 i get between 60 fps "mode lanscape" (average) and 40-45 "mode portrait". I show you 2 captures to my Statistics. Not take into account fps because i debug on my computer. I have more fps on my Iphone 6... Quote Link to comment Share on other sites More sharing options...
erixon Posted June 21, 2016 Share Posted June 21, 2016 I also noticed this on my Iphone 6 and an own static scene with some rooms and 100s of double textured triangles in total (decreased 2% per minute), tried to turn off hit detection, but it's still decreasing more than 1+% per minute. With this situation it doesn't feel so fun to do mobile games/vr and it's interesting what optimizations are possible. Like what happens if nothing is changing, is it still full 60fps calculations etc. Otherwise the FPS speed is perfect in my case. kind regards Tomas Quote Link to comment Share on other sites More sharing options...
Kesshi Posted June 21, 2016 Share Posted June 21, 2016 27 minutes ago, erixon said: With this situation it doesn't feel so fun to do mobile games/vr and it's interesting what optimizations are possible. Like what happens if nothing is changing, is it still full 60fps calculations etc. To increase the battery life in our app we are rendering only if there was a change. (e.g. the camera changed or a mesh was added) This is only possible because we don't have long animations or other things which require permanent rendering. But in the end, if the user is doing a lot of things in the app the battery is also empty very fast We need better batteries for smart phones Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 21, 2016 Author Share Posted June 21, 2016 In my situation, i launch my web page with babylon and i put the phone on my desk. No use it and i saw 10-15% consuming in 10 minutes... Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 21, 2016 Share Posted June 21, 2016 Hello I'm also interested in this topic! Have you already tried to reduce babylon engine to only the necessary for your project requirements (What I do not need goes sleep) ? For example using 512x512 Textures, also to reduce the engine call in my case of development: var engine = new BABYLON.Engine(canvas, false,{ antialias: false, preserveDrawingBuffer: true, limitDeviceRatio:1.0, generateDepthBuffer: false, generateMipMaps: false, samplingMode: 2},false); Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 21, 2016 Author Share Posted June 21, 2016 i tried to reduce babylon engine like you but no good results :/ Test at 3pm : 95% battery Result at 3.10pm : 85% battery And a very hot smartphone ! (Iphone 6) Quote Link to comment Share on other sites More sharing options...
adam Posted June 21, 2016 Share Posted June 21, 2016 @Nastro It would be helpful if you could create an example project that you could share with us. Quote Link to comment Share on other sites More sharing options...
gryff Posted June 21, 2016 Share Posted June 21, 2016 30 minutes ago, Nastro said: And a very hot smartphone ! (Iphone 6) @Nastro : Interesting I'm not a cell phone user (my fingers are too big ) but I have often wondered about the issue of webGL and the temperature on mobile phones. My desktop PC has a fan on the graphics card that is almost as big as many mobile phones. Is repeatedly using a mobile phone to view webGL creations and games likely to have an impact on the life of a cell phone ? cheers, gryff Quote Link to comment Share on other sites More sharing options...
Kesshi Posted June 21, 2016 Share Posted June 21, 2016 58 minutes ago, gryff said: Is repeatedly using a mobile phone to view webGL creations and games likely to have an impact on the life of a cell phone ? Hmm maybe you will indirectly reduce the life of the battery because you need to charge the phone more often. Another way to reduce battery consumption would be to limit the maximum FPS (e.g. to 30 instead of 60). But i think this is not possible with BabylonJs at the moment. @Deltakosh Maybe this would be a nice feature for future versions? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 21, 2016 Share Posted June 21, 2016 I am not positive about the relationship between fps & battery, but if fps is capped, improving fps should help once pegged to 60. I notice you have potential fps of 27. That means if your cpu cost was 0, that is the best you can do. You have 84 meshes, using 83 materials. All you have is 12k of vertices. Are those 83 materials truly unique? I can think of optimizations you are probably not doing, like freezingworldmatrix of your background meshes, or enabling checkOnlyOnce on all those materials. That will only help cpu though, and not get your potential fps beyond 60. Boz 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 21, 2016 Share Posted June 21, 2016 @Nastro Hello 10% Battery in 10 minutes is crazy. Please compare Babylonjs to other engines. Or even to simpel games. To be sure it is not a generall problem of your smartphone. Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 21, 2016 Share Posted June 21, 2016 I would first follow @Nabroski's advice, and benchmark test several public BJS scenes from the babylon.js demo site. This will allow other users to compare their phone's performance to yours; providing a great deal more info to begin better controlled testing. Then we might be able to begin making assumptions from there. DB Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 22, 2016 Author Share Posted June 22, 2016 @adam i will try to make an example with the same problem @gryff : I think that we have a big impact on the life of battery because as said @Kesshi you need to charge more your phone... @Nabroski i know it's crazy and i test with other smartphone to compare on my app if it's a personnal probleme or not and the consuming is not my smartphone probleme but general... @dbawel i will test some example of Babylon JS ! @JCPalmer i think that i have no optimization, so i will test your propeties. thanks all Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 22, 2016 Author Share Posted June 22, 2016 I testing on this example : http://www.babylonjs-playground.com/#170BHE#2 Same result :/ And when i trying to use SolidParticleSysteme no working :/ Quote Link to comment Share on other sites More sharing options...
jerome Posted June 22, 2016 Share Posted June 22, 2016 1664 meshes ! Have you read the post where I answered you that you called mergeMeshes() in a loop, so you generated 1664 meshes instead of one ? If you want to use the SPS, I'll need to have a read at the doc first : http://doc.babylonjs.com/overviews/Solid_Particle_System It doesn't work by adding 1 particle composed by a mesh with 1664 squares like you did in the commented code, but rather by adding 1664 times one single square model. Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 22, 2016 Author Share Posted June 22, 2016 @jerome yes i read your answers but if i understood you want to create one mesh with all meshes contains in a table ? But i need to have unicity for all color mesh represented :/ Ok it's a mistake how i use SPS i will correct it Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 22, 2016 Author Share Posted June 22, 2016 @jerome For better understanding, imagine than all box are differents. Imagine all the country of the world map. And all countries have to be animated, selected, etc... So the surfaces of their regions have to be unique. I used MergeMeshes() just for the delimitation of their regions. I have notice another thing, i can't merge all "walls", if i use this code : //var tranche = Math.abs(walls.length / 100); var m; // var iStart = 0; //for (var iTr = 0; iTr < tranche; iTr++) { //m = BABYLON.Mesh.MergeMeshes(walls.slice(iStart, iStart + 100), true); m = BABYLON.Mesh.MergeMeshes(walls, true); m.material = matwall; // iStart = iStart + 100; //} i get an error (try the sample): http://www.babylonjs-playground.com/#170BHE#7 If i can resolve this issue, i decrease meshes, and i improve certainly fps... Quote Link to comment Share on other sites More sharing options...
jerome Posted June 22, 2016 Share Posted June 22, 2016 Please read the doc about SPS first and the examples in the former posts that were answered to you : there are examples about how to have selectable or animatable parts (solid particles) adam 1 Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 23, 2016 Author Share Posted June 23, 2016 I understand a little bit how can i use SPS. I could reduce of 50% consuming battery (it's a good news but not enough). But i have a question, in this example i no use SPS and i have my "onpickAction" : http://www.babylonjs-playground.com/#QTQLX#0 And with SPS, i hope that i use it good :/ but i don't know how i use my "onpickAction" : http://www.babylonjs-playground.com/#1UCUJT Quote Link to comment Share on other sites More sharing options...
adam Posted June 23, 2016 Share Posted June 23, 2016 http://doc.babylonjs.com/overviews/Solid_Particle_System#pickable-particles jerome 1 Quote Link to comment Share on other sites More sharing options...
Nastro Posted June 23, 2016 Author Share Posted June 23, 2016 hmm ... thanks you 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.