- Home /
Texture2D manipulation in c++ dll Plugin
We're trying to display the picture of two cameras in two textures, therefore we've written a plugin. Within the Start
Method we pass the NativeTexturePtr
to the Plugin. The Update
Method triggers the plugin to refresh the texture.
This works very well as long as we run the Scene within Unity. But a builded Version doesn't display anything in the textures. We tried to add texture.Apply()
at the end of the Update()
Method, what causes a crash!
What should we do different to build the scene successful?
I have a similar problem, and one of the problematic thing is the mips. Try to uncheck the "Generate $$anonymous$$ips" from the texture import settings.
Also is your plugin written for DirectX, OpenGL or both?
Also, Texture.Apply() also seems to destroy whatever texture manipulation I did in my plugin. If you find the answer to that, I'd like to know ;)
You might want to try out the example project that can be found at the bottom of this page. Try whether it works in the Unity editor and in a stand-alone build. If it does, try adapting it to your situation. In this project, texture.Apply() is only called once in start (and getting the native pointer is done afterwards), so this might be something you could verify.
Your answer
Follow this Question
Related Questions
Using Native C++ dll in Unity 1 Answer
What is the correct location for a native (C++) plugin's DLL dependencies 1 Answer
How to step into a native C++ dll in Visual Studio? 0 Answers
Native Plugin works in editor but not in build 0 Answers
DllNotFound Exception on Editor but works on Standalone 0 Answers