- 2021-01-13 at 3:23 pm #37345
My app is not working on iPhone and iPad, can I fix it? Do I need to set anything? And apart from i-phone and i-pad can you suggest me some tricks to have a good performance on smartphones?
thank you2021-01-13 at 3:53 pm #37347Yuri KovelenovDeveloper2021-01-13 at 3:57 pm #37348jemLicensee
To elaborate on Yuri’s comment:
@andreabianchi22, you did not mention how your app is broken on iOS. For instance, does the app boot? Is it a rendering quality issue? Is it slow. Etc.
In my opinion, the first thing to keep in mind when developing for iOS is the limitation of Apple’s WebGL implementation. Due to these limitations, materials are limited to 8 textures. Light sources and ramp nodes count as textures. So, keep materials simple and minimize light sources.
In general, mobile devices do not have dedicated high-speed GPU memory (like our workstations have). You can run out of texture memory quickly on mobile. Minimize the number of texture maps that are used in a scene. Keep the dimensions of individual texture maps as small as possible. If I were targeting iOS, I would target image dimensions that are small powers of 2. For instance 128px x 128px, 256, 512. Again, there is another limitation in the WebGL implementation in iOS. It does not natively support non-power-of-two texture maps. Verge3D will automatically resize the texture for you, but it is better to manually resize the textures before you build your app (IMHO) because resizing images affects quality.
Mobile devices have limited computing power, so keep the number of polys as low as possible.
You can tether an iOS device to a Mac running Safari. This will allow you to see the dev tools and console of the iPad or iPhone. There could be some helpful debug info in Safari’s dev tools console.
If you do not have access to a Mac for debugging and are working on Chrome on Windows or Linux, pop open dev tools (f12) and look at the Verge3D performance data. Verge does warn developers if their app has too many textures for Apple. You will also be able to see performance data on polys and materials.
2021-01-13 at 6:02 pm #37353
- This reply was modified 5 days ago by jem.
Thank you very much for your help, both Yuri and Jem.
I the meantime I have tried with other devices, iPhones 14 works good, 12 quite good (just very slow) with earlier versions it doesn’t start (black display and crash before start).
I’m going to optimize the texture (surely that’s the problem) but it’s very difficult for my project to limit the texture to eight .
Just a clarification: when you say “materials have too many textures each” do you mean more texture in the same material (diffuse + normal bump + self illumination) ?
Thanks again and best regards2021-01-13 at 6:24 pm #37356jemLicensee
@andreabianchi22, yes, in iOS this is a per-material limit. So, for a particular material, the diffuse, normal, metallic, etc. all count towards this limit of 8. But, some other things count as well. As Yuri pointed out each light source adds to this count as do certain shader nodes. There was an earlier forum post on this where Yuri said that these nodes use a texture slot:
- Image Texture
- Color Ramp
- Vector Curves
- RGB Curves
The environment counts as a texture slot also.
Again, look in your dev tools console. There could be some useful messages from Verge3D in there.2021-01-13 at 6:44 pm #37357
very good, thank you for your time
- You must be logged in to reply to this topic.