finds.dev← search

// the find

Unity-Technologies/NativeRenderingPlugin

★ 936 · C · MIT · updated May 2025

C++ Rendering Plugin example for Unity

Official Unity sample showing how to write a C++ native rendering plugin that hooks into Unity's graphics backend. Covers the full loop: initializing the graphics API, issuing draw calls, and mutating Unity-managed textures and mesh buffers from native code. Aimed at developers who need to drop below Unity's abstraction layer for custom renderers, compute work, or porting existing C++ graphics code.

Covers a wide range of backends in a single codebase — D3D11, D3D12, Metal, OpenGL, Vulkan, OpenGL ES — with each in its own RenderAPI_*.cpp file, making it easy to read just the one you care about. The texture and mesh native pointer examples are practically copy-pasteable for real use cases (video decoders, simulation data uploads). It's maintained by Unity Technologies themselves, so the IUnityGraphics* headers track the actual plugin interface rather than community reverse-engineering. Pre-built plugin binaries are included in the Unity project, so you can run and inspect the sample before touching any build tooling.

Vulkan and D3D12 support is disabled by default behind preprocessor flags and requires manual SDK setup with no scripted path to enable them — a friction point given those are the backends most people actually want to learn. The sample only draws a rotating triangle and a plasma texture; there's nothing showing render textures as render targets, multi-pass pipelines, or synchronization with Unity's command buffer system, which are the real pain points in production plugins. The Android build still uses the legacy Android.mk/Application.mk NDK build system rather than CMake, which will confuse anyone who hasn't used ndk-build. No CI, so there's no guarantee a given commit actually builds on all the listed platforms.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →