Skip to main content
B
14d ago

Inefficient rendering Unity

Unity re-renders all static vector objects every single frame. If there is a scene with a large amount of objects (no state machines), it can easily take up 80% of the mobile GPU (draining the battery). Other platforms (React Native) don't have this problem. There is something wrong with the current Unity implementation. Please check.

2 replies
B
13d ago

Just to make sure I have the full picture, there are no state machines, which means you're not calling statemachine.Advance() in your unity script, right?

Is that correct? Just want to make sure this is completely rendering-related. The Unity plugin uses the Rive Renderer, so this wouldn't necessarily be a Unity-specific thing and would affect any runtime that uses the Rive Renderer. I believe the React Native package still uses Skia instead of the RiveRenderer.

Are you testing on an iOS build or Android?

B
(edited) 12d ago

Indeed there are no state machines. Advance is called in the RiveScreen script but it should not do anything because there are no state machines in the riv file. I am testing mostly on Android (Galaxy ultra S22) but it has the same issue on IOS (iPad gen 9).

I emailed a repo (subject "Android GPU usage bug"). It's 100% reproducible. Note that the GPU usage view on the Unity profiler is not that accurate. I use an on-device GPU logger called "CPU/GPU Meter & Notification".