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: Unity - Manual: Low-level native plug-in interface

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.

29062-capture.png

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?

If you have upgraded to 4.5, I noticed that I had to move the dll into Plugins/x86 for it to work.

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.

This fixed the problem for me:

  1. Close Unity
  2. Delete \Library\metadata\
  3. Delete everything in \Assets\Plugins\ and then place your .dll in it
  4. Restart Unity and let it reload the metadata