Jump to content

Smartphone Battery Consuming


Nastro
 Share

Recommended Posts

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

Link to comment
Share on other sites

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...

 

 

Capture.PNG

Capture2.PNG

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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);
Link to comment
Share on other sites

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 :o ) 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 :)

Link to comment
Share on other sites

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. :D

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...