Optimisation advice Desktop/Mobile

I have a project , which needs to be done on mobile and Desktop platforms (browsers).
Since mobile and desktop version has to be in the same project, came up with the plan to load assets in run time through start function, assets for mobile and desktop, separately.
Also for the UI, I made sprite atlas and cut all UI in Sprite editor.

Is there something else I should do besides having to merge 3D models, loading files separately for specific platforms, and making big atlas map for sprites ?
Be aware that i am doing optimisation mostly for mobile browser , that’s out main focus here

You could remove all assets from preload that need to be switched on mobile and/or desktop.

Once the preload is done, you can do a secondary load using the assets registry based on whether they are on a low/high performance device.

Other things you can do is to change the pixel ratio based on the device: https://developer.playcanvas.com/en/user-manual/optimization/runtime-devicepixelratio/

And/or you can use resolution scaling: https://playcanvas.com/project/708300/overview/resolution-scaling

3 Likes

Pixel ratio increased FPS at maximum on mobile phone
But on PC with integrated GPU , it’s still on 30 fps , no matter what i do.
Is there any way to check is user using device with integrated GPU ?

Try disabling anti aliasing from the rendering tab for PC, it increases the FPS.

You should be able to use the same technique in the https://developer.playcanvas.com/en/user-manual/optimization/runtime-devicepixelratio/ guide to detect what desktop GPU they have.

var renderer = pc.Application.getApplication().graphicsDevice.unmaskedRenderer

There’s other factors to consider as well such as the dimensions of the browser (the larger the dimensions, the more pixels you have render). You can use the resolution scaling technique to further reduce the resolution without losing UI quality.

With profiler I realized that i have 35 shader/materials in scene , it’s actually 25 sprites from same texture , which i sliced with sprite editor.
It should be the same shader/material , is there any procedure for PlayCanvas to recognized this as 1 material ?

Hi @Dava,

Materials are grouped to use the same shader when they share the same properties.

Not sure about the metrics you get on your project, could you share a sample project to take a look?

1 Like