Is it possible to render custom objects in the Unity game window using native (opengl) code ?

Hi,

I am using a closed source 3rd party lib/dll to draw a custom 3d object in my game.

I have created the appropriate native code (c++/opengl) unity plugins for iOS and Android.

The custom object renders on my iOS and Android devices appropriately.

However, this object does not currently render in the Unity Game window.

I wanted to ask if it is possible and/or officially supported to render something custom in the unity game window using native code (c++/opengl).

If so, can it be done with a game object that requires the use of a .a or .dll file ?

If not, is there an appropriate or supported way to accomplish this ?

1 Answer

1

The answer seems to be YES!
(It does seem to be a pro/mobile only feature though)

There is a page available on the unity site regarding this:

And a project sample:
http://docs.unity3d.com/Documentation/Images/manual/RenderingPluginExample42.zip

And in regards to using 3rd party dlls/libs with native code, that should also work too.

It can also happen if you're using bilinear filtering in combination with a sprite sheet. The shader will actually sample from adjacent pixels in the sprite sheet when doing the filtering.