🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Unity - Scraping Back Buffer

Started by
0 comments, last by Catch_0x16 5 years, 5 months ago

Hello folks,

In my company we use Unity on both Windows desktop machines, and Android tablets/phones. We have a requirement to be able to stream raw imagery from these devices over the network during their use (so that we can run algorithms on the image data).

On a Windows machine, running DirectX9 this was really easy, I just wrote a C++ native plugin that created an offscreen surface and copied the contents of the backbuffer into it. However I'm having difficulty in working out how we can do this for OpenglES (phones and tablets).

I have two main questions:

  1. Does the Native C++ plugin API work on android devices? (does Unity build the .so files into the .apk?)
  2. How do I scrape the backbuffer in OpenGL ES?

And also, I am curious as to whether there is a quick and efficient way to do this via script in Unity itself? I managed to get the buffer pixels, but had trouble running a separate network thread and getting the two working in sync without issues surrounding having to do everything on the rendering thread.

Any help and advice would be much appreciated.

Thanks!

This topic is closed to new replies.

Advertisement