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.

I'm interested in the answer, and in your humor !

–

1 Answer

1

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

Mind 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!

–