https://github.com/floe/unity-android-native-texture
Minimal example of how to dynamically update a texture in Unity on Android from native C++ code.
https://github.com/floe/unity-android-native-texture
android mmbuw ndk opencv texture unity
Last synced: 4 months ago
JSON representation
Minimal example of how to dynamically update a texture in Unity on Android from native C++ code.
- Host: GitHub
- URL: https://github.com/floe/unity-android-native-texture
- Owner: floe
- Created: 2018-08-28T17:24:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-31T09:01:19.000Z (almost 8 years ago)
- Last Synced: 2025-04-08T06:13:00.795Z (about 1 year ago)
- Topics: android, mmbuw, ndk, opencv, texture, unity
- Language: C++
- Homepage:
- Size: 78.1 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unity-android-native-texture
Minimal example of how to dynamically update a texture in Unity on Android from native C++ code.
Should also work on Linux deployments with minimal changes, not tested yet.
Note: before deploying the Unity project, you need to build the native library in `Assets/Plugins/Android/src/` by setting `$ANDROID_NDK_ROOT` and running `build_plugin.sh`. This uses the old-style ndk-build process, should be upgraded to CMake and properly integrated with Unity at some point.
Branches:
- `master`: a procedural texture in C passed to Unity
- `camera`: a live camera view from the NDK -> Unity
- `opencv`: live camera view processed with OpenCV -> Unity
Built/tested with:
- Unity 2018.2.4f1
- Android NDK r15c
- Android 8.0 Oreo (API level >= 24)
- OpenCV for Android 3.4.1
Sources:
- https://docs.unity3d.com/Manual/AndroidNativePlugins.html
- https://bitbucket.org/Unity-Technologies/graphicsdemos/src/364ac57cea5c197ca9b7015ba29dcc1ff94c9f61/NativeRenderingPlugin?at=default