问题
I'm developing a 3D game with ARKit and SceneKit. The game running smoothly at 60 fps but when I keep using it for a while the device get hot and the frame rate drop to 30 fps. The energy impact is very high and I noticed something in Instruments. I'll show the statistics and what I see in Instruments. This are the statistics when the game is running smoothly but I don't understand why I get 1.16K as the nodes count. I actually don't use so much nodes but it's just a simple level.
This is what I get on Instruments, I don't know what it means. As you can see here the energy impact is very high
How can I find out why the fps getting low and the device getting hot with the usage?
回答1:
Using ARKit's 6 DoF tracking at 60 fps along with SceneKit's or RealityKit's rendering (of poly geometry, PBR shaders and shadows) at 60 fps is extremely heavy burden for the processor and graphical unit. It also drains your battery very fast and makes the phone generate a lot of heat. For AR, VR and AI apps it's a common issue though.
To lower an energy impact follow these recommendations:
- Keep the total number of polygons of your model not more than 10K
- Use not more than 50K polygons per a scene (use low-poly models)
- Don't use ray-traced shadows (use pre-baked or fake shadows)
- Try not to use many PBR shaders, like metallic or reflective materials
- Try to lower a tracking frame rate and, if needed, a rendering frame rate
- Take into consideration that physics consumes much processing power
- Do not use high-resolution JPEG or PNG textures for your 3D models
来源:https://stackoverflow.com/questions/57012473/scenekit-ar-game-fps-getting-low-and-the-device-getting-hot-with-use