https://github.com/nosix/unityandroidtexturerendersample
This is a sample to draw on Unity Texture with Android Plugin.
https://github.com/nosix/unityandroidtexturerendersample
Last synced: 9 days ago
JSON representation
This is a sample to draw on Unity Texture with Android Plugin.
- Host: GitHub
- URL: https://github.com/nosix/unityandroidtexturerendersample
- Owner: nosix
- License: apache-2.0
- Created: 2021-03-23T03:12:27.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-23T09:25:22.000Z (about 4 years ago)
- Last Synced: 2025-04-24T03:08:57.439Z (9 days ago)
- Language: Kotlin
- Homepage:
- Size: 98.6 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UnityAndroidTextureRenderSample
This is a sample to draw on Unity Texture with Android Plugin.
## Verified environment
- Emulator
- Android 9.0 (Google Play), API 28, x86
- Android 11.0 (Google Play), API 30, x86
- Device
- Android 8.1, API 26, QUALCOMM SDM845 for arm64 (Nreal Computing Unit)
- Android 10, API 29, Galaxy S9 (SCV38)## Usage
1. Open TextureRendererPlugIn project on Android Studio
2. Publish AAR
```shell
./gradlew publishToMavenLocal
```
3. Open AndroidTextureRendererExample project on Unity Editor
4. Switch Platform to Android
5. Select Run Device
6. Build and Run## Abstract
- This will generate an EGLContext for the thread that draws with the Android Plugin.
- The generated EGLContext shares Unity's EGLContext.
- The Texture target passed by Unity can be TEXTURE_2D or TEXTUER_EXTERNAL_OES.
- In the verification environment,
- the target in the emulator is TEXTUER_EXTERNAL_OES
- the target in the device is TEXTURE_2D
- If the target is TEXTURE_2D, draw it on the offscreen texture and then copy it to the Unity texture.
- If the target is TEXTUER_EXTERNAL_OES, draw directly on the Unity texture.