rive-unity icon indicating copy to clipboard operation
rive-unity copied to clipboard

Working on mobile?

Open NikitaGedzhua opened this issue 1 year ago • 20 comments
trafficstars

Working on mobile?

NikitaGedzhua avatar Dec 14 '23 19:12 NikitaGedzhua

Metal on iOS is supported, So iphones and ipads. For android Vulkan support is planned, but that is like 85% of phones but even then most of these vulkan phones are mid-tier and some are low spec phones. All of these high performance renderers like Rive renderer or Vello Renderer are next generation tech which is fast on fast devices, no matter how much compatibility they claim using PLS. Total Mobile device coverage is not feasible with high performance tech that will drain all the battery if enabled (full throttle).

Saurabh7SSR avatar Dec 15 '23 08:12 Saurabh7SSR

Thanks for the quick response, as I understand it, Android 2022+ that is not on a Vulkan will not work?

NikitaGedzhua avatar Dec 15 '23 10:12 NikitaGedzhua

Vulkan API was released around 2015, but there are low spec phones that support vulkan API but have weak processors. here is the android device distribution: https://developer.android.com/about/dashboards

Rive Renderer using Rive Android checks for devices that support Pixel Local Storage if they don't is switched back to skia renderer.

Point I am trying to make is, consider Rive renderer to increase efficiency and preserve battery for mobile, to do that keep number of animations low enough that if it was skia renderer it will not have frames dropping on older devices.

Saurabh7SSR avatar Dec 15 '23 13:12 Saurabh7SSR

@HayesGordon Does this mean decreased performance on android, or does it just mean rive not working at all? Right now im trying an embeded unity app inside flutter, using rive, and the animated rive texture gets rendered as a black motionless texture. The rest of the unity proyect works well. Any workarounds? And if not potential timescale when this could be shipped? I have tried building with both OpenGLES3 and vulkan separately

marcolatellafrias avatar Feb 28 '24 17:02 marcolatellafrias

Check vulkan compatibility on your phone with this app: https://play.google.com/store/apps/details?id=de.saschawillems.vulkancapsviewer&hl=en_US

Only Vulkan capable devices will be supported by rive-unity as per their docs.

Saurabh7SSR avatar Feb 29 '24 08:02 Saurabh7SSR

Thanks for the reply, they told me i have to switch Unity to the GL Core renderer for it to work with android. This should work on OpenGLES 3? I have tested it with both vulkan and opengles 3 together, and each one separately, with all arm v7, and arm64 combinations also and rive will just produce a black texture on android (not on desktop). Here are my player settings on android, and my vulkan settings on the phone im testing right now

image image

marcolatellafrias avatar Mar 01 '24 03:03 marcolatellafrias

The Vulkan renderer for Rive is not available yet. We're anticipating it being available in the next month.

On Android we've only tested OpenGL Core, although ES3 should work too.

We did have someone else report issues with IL2CPP, can you try using the mono backend to see if that makes a change?

luigi-rosso avatar Mar 01 '24 04:03 luigi-rosso

I just tried building with mono, but unfortunately the library we are using for embeding unity into flutter, requires IL2CPP, otherwise it will not compile.

marcolatellafrias avatar Mar 01 '24 05:03 marcolatellafrias

When I have the RiveTexture.cs file including the m_riveRenderer.Submit(); then it doesn't work (completely black screen, not just the material on the renderer failing). Leaving it out makes the Rive animation not render. Tested on Android OpenGLES URP IL2CPP. The supported renderers are now updated to include OpenGL on Android. One would expect it to work then.

pjarnfelt avatar Mar 14 '24 12:03 pjarnfelt

I have tried building with Mono and IL2CPP to no avail. I tried putting in a delay for m_riveRenderer.Submit() and sure enough. When this is triggered, the entire screen goes black and no error messages are thrown.

pjarnfelt avatar Mar 14 '24 15:03 pjarnfelt

Android OpenGL ES 3.2 device fails to render rive with il2cpp or mono. Please confirm if you have any opengl es working.

Any android test devices that you have tested it on.

Vulkan support is keenly awaited.

Saurabh7SSR avatar Mar 27 '24 22:03 Saurabh7SSR

Any update on this? @Saurabh7SSR is the Vulcan support ready?

parth-choudhary avatar Jun 10 '24 10:06 parth-choudhary

Hi @parth-choudhary , Vulkan support for Rive in Unity is not available yet, but it is something that we're working on!

@pjarnfelt If you add GL.InvalidateState(); after the m_riveRenderer.Submit(); does that help with the black screen issue?

damzobridge avatar Jun 21 '24 20:06 damzobridge

@damzobridge Are there any updates on this? Could you provide an approximate timeline for when Vulkan support might be available? Our platform's game performance is highly reliant on Vulkan, so this is critical for us.

surendrancj avatar Sep 02 '24 05:09 surendrancj

Are there any updates on this? Could you provide an approximate timeline for when Vulkan support might be available? Our platform's game performance is highly reliant on Vulkan, so this is critical for us.

@surendrancj We're still actively working on this! I can't give a specific timeline yet, but we're close to having something we can share hopefully soon.

damzobridge avatar Sep 03 '24 23:09 damzobridge

bump

The Vulkan renderer for Rive is not available yet. We're anticipating it being available in the next month.

Any update @luigi-rosso

Saurabh7SSR avatar Nov 11 '24 13:11 Saurabh7SSR

hey folks any update on this ? The rive file is working fine in the editor, but when I build an Android app, everything works except the rive file is not loading in the console. It shows the rive file corrupted. I tried every example file as well; they are also not coming in the Android build. Please help.

jatin-baba avatar Apr 02 '25 03:04 jatin-baba

@jatin-baba Can you confirm that you're using OpenGL as your graphics API on Android in your Unity project settings?

damzobridge avatar Apr 02 '25 16:04 damzobridge

@Saurabh7SSR @surendrancj Vulkan support is available as of v0.3.6 . Let us know if you run into any issues!

damzobridge avatar May 02 '25 22:05 damzobridge

Wow let's try this out! Gotta say if this works Rive has gone the distance with data binding and now this. Kudos!

Saurabh7SSR avatar May 03 '25 00:05 Saurabh7SSR