- Home /
CVOpenGLESTextureCache texture from native plugin (iOS)
I currently have a plugin that takes the camera image and sends it to the gpu in a plugin using glTexImage2D using the common methods described to get the native texture ID from the Texture2D object attached to my object. The only problem is that this is a very inefficient way to send the camera image to the GPU and profiling has shown it is taking up a lot of our cycles.
In iOS 5 CVOpenGLESTextureCache was introduced which is supposed to improve performance by up to 10x over sending the video to the GPU via glTexImage2D. Unfortunately this method doesn't allow you to specify the texture ID like glTextImage2D did, it gives you a texture id for the texture. The Unity texture classes also don't let you specify a native texture ID and overriding it in a subclass doesn't seem to work either.
I was wondering if anyone has any crazy ideas for a hack to get this working. You can check out the Apple sample code called RosyWriter and GLCameraRipple for example implementations.
Jon, I'm trying to understand how something like this could work as well. Did you ever arrive at a solution? Thanks.
It doesn't look like this is possible with Unity 3.x and it doesn't seem like support will be added. There seems to be some hope that this will be some way to make it work in Unity 4.x when it is released but haven't seen any confirmation yet.
Jon, thanks for the update. I guess I'll wait for Unity 4.x. In the meantime, if I discover anything, I'll post back here.
Your answer
Follow this Question
Related Questions
iOS Unity Plugin : Load Video from 'Videos'app and Photo Library on iOS Device 0 Answers
Unity Camera roll on iOS - access information about photos and videos 0 Answers
3D Video within Scene 1 Answer
Trouble getting Google GVRVideoPlayer to Implement in Unity 5.6.2 with Google Cardboard v1.60 0 Answers
Native Alert on iOS (plugin) 1 Answer