- Home /
Low-level native plugins not working in 4.3 on Windows
I've been trying to write a low-level native rendering plugin for my project but I never receive calls to UnitySetGraphicsDevice(void* device, int deviceType, int eventType)
or UnityRenderEvent(int eventID)
.
I have a Unity Pro license, am running on Windows, and can confirm that both methods are exported by my .dll which is stored in the Assets/Plugins/ directory.
I've also tried downloading the sample project found on this page: http://docs.unity3d.com/Manual/NativePluginInterface.html
The download link for that sample project is found here: http://docs.unity3d.com/uploads/Examples/RenderingPluginExample45.zip
If I build the rendering plugin from that example and drop it in my project, it doesn't work. If I open the example scene in Unity, it doesn't appear to be working either.
Note that there is no triangle rendering in the middle, and the texture has not been filled correctly.
Has anyone else run into this issue? Is there a piece I'm missing to get this working?
Answer by teddytrowbridge · Aug 12, 2014 at 11:27 PM
This fixed the problem for me:
Close Unity
Delete
\Library\metadata\
Delete everything in
\Assets\Plugins\
and then place your .dll in itRestart Unity and let it reload the metadata
Answer by _alia_ · Jul 22, 2014 at 10:12 PM
If you have upgraded to 4.5, I noticed that I had to move the dll into Plugins/x86 for it to work.
I tried this and I'm no longer getting the DllNotFoundException, but i'm still not seeing the triangle or the texture.
I'm on 4.5.2f1.
Answer by Sedes · Jul 24, 2014 at 09:13 PM
As @alia suggested, in 4.5 it appears you need to move the RenderingPlugin.dll into the Assets/Plugins/x86.
The other thing that you need to do (at least I did) was force the editor to run in OpenGL mode. To do this, run Unity.exe from the command line with the -force-opengl
flag.
Your answer
Follow this Question
Related Questions
native android plugin 0 Answers
Writing user define and in built method for android 0 Answers
NullReferenceException in a wrapper 0 Answers
Releasing plugin in script 0 Answers
Is there any way to make Native Audio Filter like Unity ReverbZone? 1 Answer