Unity-Technologies/NativeRenderingPlugin
FreeC++ Rendering Plugin example for Unity
About Unity-Technologies/NativeRenderingPlugin
This repository provides a C++ native code rendering plugin example for Unity, demonstrating how to render graphics and interact with Unity's rendering pipeline through the native plugin interface. The plugin showcases basic plumbing, drawing a colored rotating triangle, modifying Unity texture pixel data with an animated plasma pattern, and altering mesh vertex data with a heightfield animation. It supports a wide range of platforms and graphics APIs including Windows (D3D11, D3D12, OpenGL, Vulkan), macOS (Metal, OpenGL), Linux (OpenGL, Vulkan), UWP (D3D11, D3D12), WebGL (OpenGL ES), Android (OpenGL ES, Vulkan), iOS/tvOS (Metal), EmbeddedLinux (OpenGL, OpenGL ES, Vulkan), and QNX (OpenGL ES). The code is organized into PluginSource with project files for Visual Studio 2022, Xcode, GNUMake, and others, and a UnityProject containing a sample scene. Licensed under MIT.
Key Features
Pros & Cons
- Wide platform and graphics API support (D3D11/12, Metal, OpenGL, Vulkan, OpenGL ES)
- Demonstrates multiple rendering techniques (drawing, texture manipulation, mesh vertex modification)
- Well-organized code with separate source and project files
- Official repository from Unity Technologies, actively maintained
- MIT license allows unrestricted use and modification
- Vulkan and D3D12 support requires manual enabling and additional SDK installation
- Example is minimal and not production-ready
- Default branch requires Unity 2023.1+
- Documentation relies on external Unity Manual references