Problems sharing textures with plugin in Unity 5
Hi everybody,
I'm trying to do an android java plugin. I am developing a kind of basic video editor.
What I'm trying to do is to open a movie frame to frame (in the plugin), give each frame to Unity and mix Text, effects... in a RenderTexture, and give back the frame to the plugin to create a new movie. Now I have it working using bytebuffers, but it's extremely slow in android.(I have it running in iOS slightly slower than real time)
I tried then to use directly textures to avoid using bytebuffers and I found that if I use multithread render I have problems creating the external texture with the texture id given by the plugin, and even with the multithread render disabled, When I try to get the pixels from the texture created in Unity with the current frame (using a framebuffer and glReadPixels), I only get a black video with no other error.
Reading Unity Help, I think I have to use GL.IssuePluginEvent with the functions that read or write from the textures in my plugin, so I thing I have to do something similar to what you are doing in your sample Native rendering plugin from https://bitbucket.org/Unity-Technologies/graphicsdemos/src/43011994ae74ebf5e39bfe0055990cb349a4ae09/NativeRenderingPlugin/, but this sample is not for Android and I have not found information about how to port this sample to android to have an starting point to solve my problem.
I am using Unity 5.3.5f1.
I don't know if I'm on the right track or if exists an easier way to solve that problem, might you help me with this issue please.
Your answer
![](https://koobas.hobune.stream/wayback/20220612130455im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Implement multiple OpenGL context for background texture loading. 1 Answer
Android plugin - how to create a daily notification 0 Answers
Hello.I use the Region Capture to create the coloring of augmented reality. 0 Answers
Unity - How to add native view to Unity main activity? 0 Answers
Unable to load libmain.so in android studio and unity as library 0 Answers