프로젝트
GitHub에서 보기
Unity-Technologies/NativeRenderingPlugin
Unity-Technologies/NativeRenderingPlugin has 950 GitHub stars and 190 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-22 21:10 UTC. Last push 2026-08-10.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
C++ Rendering Plugin example for Unity
창작 및 미디어README.md
OriginalNative code (C++) rendering plugin example for Unity
This sample demonstrates how to render and do other graphics related things from a C++ plugin, via a native plugin interface.
Unity versions:
- 2023.1+ use tip of default branch.
The plugin itself does very few things:
- Demonstrates basic plumbing. How to initialize the graphics API, and how calls from Unity into plugin are made.
- Draws a triangle. A single colored rotating triangle in the middle of the screen. For each backend API, this shows bare basics of how to setup vertex data, setup some shaders or render states, and do a draw call.
- Changes Unity texture data. Unity side passes a texture into the plugin, and the code changes the pixels of it each frame, with an animated "plasma" pattern. This demonstrates how to work with Texture.GetNativeTexturePtr.
- Changes Unity mesh vertex data. Unity side passes a vertex buffer into the plugin, and the code changes the vertices each frame, with an animated "heightfield" pattern. This demonstrates how to work with Mesh.GetNativeVertexBufferPtr.
Native code rendering is implemented for several platforms and graphics APIs:
- Windows (D3D11, D3D12, OpenGL, Vulkan)
- Note that Vulkan and DX12 are not compiled in by default
- Vulkan requires Vulkan SDK; enable it by editing
#define SUPPORT_VULKAN 0to1underUNITY_WINclause inPlatformBase.h - DX12 requires additional header files (see on github or nuget package); enable it by editing
#define SUPPORT_D3D12 0to1underUNITY_WINclause inPlatformBase.h
- macOS (Metal, OpenGL)
- Linux (OpenGL, Vulkan)
- Windows Store aka UWP (D3D11, D3D12)
- WebGL (OpenGL ES)
- Android (OpenGL ES, Vulkan)
- iOS/tvOS (Metal; Simulator is supported if you use unity 2020+ and XCode 11+)
- EmbeddedLinux (OpenGL, OpenGL ES , Vulkan)
- QNX (OpenGL ES)
- ...more platforms might be coming soon, we just did not get around to adding project files yet.
Code is organized as follows:
PluginSourceis source code & IDE project files for the C++ plugin.source: The source code itself.RenderingPlugin.cppis the main logic,RenderAPI*.*files contain rendering implementations for different APIs.projects/VisualStudio2022: Visual Studio 2022 project files for regular Windows pluginprojects/UWPVisualStudio2022: Visual Studio 2022 project files for Windows Store (UWP) pluginprojects/Xcode: Apple Xcode project file for Mac OS X plugin, Xcode 10.3 on macOS 10.14 was testedprojects/GNUMake: Makefile for Linuxprojects/EmbeddedLinux: Windows .bat files to build plugins for different architecturesprojects/QNX: Makefile for Linux requires QNX to be installed and environment variables to be set
UnityProjectis the Unity (2023.1.15f1 was tested) project.- Single
scenethat contains the plugin sample scene.
- Single
What license are the graphics samples shipped under?
Just like with most other samples, the license is MIT/X11.
관련 프로젝트 살펴보기
불러오는 중…