Start a new topic

Invert Frames ABGR to RGBA

I'm using the InputPlugin API to apply a video stream into Wikitude, but the frames are in ABGR (causing the image to be upside-down).

In the Wikitude documentation, the InvertFrame toggle only works for RGBA color frames.

Is there any other way to invert the frames (or the Wikitude Texture) without wasting CPU time?

Unity 2019.2.14

Wikitude SDK for Unity 8.10.0

1 Comment


Are you submitting the ABGR frames directly to the SDK? It's very likely that we will not be able to read the data correctly. Are you using any kind of tracking (image, object)? Does it work correctly? I'm also not sure why the image would be upside-down in this case. I would expect that the colors would be wrong when rendered to the screen, but not that the image itself would be flipped.

I would recommend converting the data before submitting it. The easiest but also the slowest way is to do this in C# code, but if the frames are small and the devices you plan to run on are powerful enough, it might not matter. An alternative method would be to write a native plugin that would do the conversion in native C code. This would definitely be faster, but depending on how may platforms you need to support, it might get too complicated to maintain. A third option would be to use the DOTS system in Unity. If it's properly implemented, the conversion could be just as fast as native code, and could even take advantage of multiple cores and SIMD instructions. However, if you're not familiar with DOTS, learning it just for this might be too much.

If tracking is working ok for you, you could also try to render the camera frame yourself and disable the camera frame rendering in the SDK. That way, you can just flip the UVs and not the data itself.

Best regards,


Login or Signup to post a comment