• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by nikxio · Nov 17, 2012 at 11:25 AM · renderingpluginlinuxnative

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?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vagran · Aug 26, 2013 at 08:44 AM 0
Share

Our project encountered the same problem when our native plugin was ported to Linux. Are there any plans to fix it?

avatar image nikxio · Aug 26, 2013 at 01:04 PM 0
Share

(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.

avatar image vagran · Aug 26, 2013 at 02:09 PM 0
Share

Thank you for the hint! I have verified that - it really works now!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

External terrain renderer 0 Answers

Linux build is putting libNative.so in wrong place 1 Answer

OpenGL Context from Plugin 1 Answer

Native Rendering Plugin with Oculus Rift 0 Answers

Native rendering plugin OpenGL device type not being set. 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges