Native plugin support callbacks issue on Linux in Unity 4.0

Hi, I’ve posted this issue on the Unity Answers section but since nobody replied I’ll try my luck on the forums :slight_smile:

So, I want to do some rendering in a native plugin and I have that working on Windows (supporting both DX and OpenGL). Now that Unity 4.0 supports Linux, I wanted to port the code - the distribution I’m testing on is Ubuntu 12.04.

According to this documentation Unity will call UnitySetGraphicsDevice (and UnityRenderEvent when issued) but it just doesn’t when running on Linux. I’ve also tried running the example project (RenderingPluginExample40) and it doesn’t seem to work either - this is the image I got:

The C++ code needed some modification for the OpenGL include because it assumed I’m working on a Mac. After I fixed the include and compiled it, I could verify that it’s loaded and functions that were explicitly marked as DllImported from the RenderingPlugin .so were indeed called (e.g. SetTimeFromUnity).

Has anyone managed to get native rendering plugins working on Linux, or is there any official information that this is not yet supported?

It’s been more than a month with no response - I’m wondering am I the only one having this problem? Are there any additional steps I’m missing or the Linux version of Unity is just incomplete?

I also ran into this same problem under linux, and without this functionality we won’t be able to use Unity for our next project… Manual callbacks seem to work ok (if called from a script) but just as you describe the render events are not being called.

I’ll probably do some more digging with strace/ltrace but was hoping to find out if any of the developers are looking at this issue.

Well, at least I know I’m not the only one having this problem :). As you said it would be nice to get some official dev info, but right now there’s none that I found. I was hoping to see a fix in 4.0.1 but it isn’t there either.

Hi,
Are there any news about this topic? Our project also needs native plugin working on Linux. Now it perfectly works on Windows, but does not work on Linux by the reason described above - UnitySetGraphicsDevice and UnityRenderEvent are not called from the framework. Used version - 4.1.5.f1 Pro. Are there any plans to fix it?

They fixed it in 4.2 - you can see it in the changelog under “Linux: Enable native rendering plugin callbacks.”