- Home /
Can Unity utilize textures created by a plugin?
If I create a texture with the Direct3D device passed to a native plugin, is there a way to access it for use in the Unity system? I need this for high performance video streaming because Texture2D.Apply() and Human.MakeCoffee() are too similar in duration.
Answer by wtgo · Apr 08, 2012 at 03:42 AM
Still not sure if/how it can be done with Direct3D, but I got this working beautifully when forcing OpenGL. I passed the value of Texture2D.GetNativeTextureID into my native plugin, then did a glBindTexture and glTexImage2D update in UnityRenderEvent. Now I have alpha videos streaming so fast that I'll miss them if I make coffee.
For more info: http://unity3d.com/support/documentation/Manual/NativePluginInterface.html http://answers.unity3d.com/questions/39228/cannot-update-texture-from-plugin-windows.html#answer-236922
$$anonymous$$ind posting your code for this? I'm doing the same thing in theory but am not getting the texture to update in Unity...
A code sample would be greatly appreciated. I can post what I've done so far if requested. Thanks for your help!
Your answer
Follow this Question
Related Questions
Native Android plugin CPU subfolder approach not working 1 Answer
How to get pixels from an external texture? 1 Answer
How should I release a DirectX11 texture created in a native plugin? 1 Answer
Is Texture.apply() for Unity == glTexSubImage2D on native side on Unity 1 Answer
Out of ideas on how to make this plugin work again, please HELP! 1 Answer