- Home /
Native rendering plugin doesn't work on Linux
Hi, I've been trying to port some code to Linux now that Unity 4 supports it. I need to do some high performance rendering, so I'm relying on some callbacks from Unity - namely the ones specified here http://docs.unity3d.com/Documentation/Manual/NativePluginInterface.html. I'm using Ubuntu 12.04 for my tests.
The problem is they are not getting called at all. At first I though the problem was within my code but then I tried the RenderingPluginExample40 that comes with the installation and the result was the same.
I'm getting the feeling plugins aren't fully supported on Linux as the rendering plugin example doesn't even compile as-is and there are no defines for Linux either - the code assumes you're on Mac OSX if you're not on Windows and the OpenGL include is wrong. After I fixed it I compiled the .so with
g++ -c -fPIC RenderingPlugin.cpp -o RenderingPlugin.a -lGL
g++ -shared -Wl,-soname,libRenderingPlugin.so -o libRenderingPlugin.so RenderingPlugin.a
I've verified that the shared object loads correctly and the methods in the example C# script that use DllImport are executed - only the rendering callbacks from Unity aren't.
Needless to say, both my code and the example run fine on Windows.
So the question is, are plugins (and callbacks) fully supported for Linux?
Our project encountered the same problem when our native plugin was ported to Linux. Are there any plans to fix it?
(Solved) Unity 4.2 fixes the problem - you can see it in under http://unity3d.com/unity/whats-new/unity-4.2 "Linux: Enable native rendering plugin callbacks.". I can verify it works with that version.
Thank you for the hint! I have verified that - it really works now!
Your answer
Follow this Question
Related Questions
External terrain renderer 0 Answers
OpenGL Context from Plugin 1 Answer
Linux build is putting libNative.so in wrong place 1 Answer
Can Unity utilize textures created by a plugin? 1 Answer
Native Rendering Plugin with Oculus Rift 0 Answers