|
1 | 1 | # UnityCustomTextureRenderer |
2 | 2 |
|
3 | | -A graphics utility to update textures from native plugins. |
4 | | -The function for updating textures runs on Unity's Render Thread or another thread. |
| 3 | +A graphics utility to update textures from native plugins. |
5 | 4 |
|
6 | | -IL2CPP is currently not supported. |
| 5 | +## NonBlockingCustomTextureRenderer |
| 6 | +`NonBlockingCustomTextureRenderer` is a high performance graphics utility to update textures from native plugins. |
| 7 | + |
| 8 | +<image src="./Docs/NonBlockingCustomTextureRenderer.gif" width="40%"> |
| 9 | + |
| 10 | +The function for updating textures runs on another thread. |
| 11 | +Asynchronous GPU upload (partial data copy) reduces the processing time per frame in the main thread for large size textures. |
| 12 | + |
| 13 | +`NonBlockingCustomTextureRenderer` is available on IL2CPP. |
| 14 | + |
| 15 | +## CustomTextureRenderer |
| 16 | +`CustomTextureRenderer` is an example to update textures from native plugins |
| 17 | +using [CommandBuffer.IssuePluginCustomTextureUpdateV2](https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.IssuePluginCustomTextureUpdateV2.html). |
| 18 | + |
| 19 | +<image src="./Docs/CustomTextureRenderer.gif" width="40%"> |
| 20 | + |
| 21 | +The function for updating textures runs on Unity's Render Thread. |
| 22 | + |
| 23 | +`CustomTextureRenderer` does not work on IL2CPP. |
7 | 24 | ``` |
8 | 25 | NotSupportedException: |
9 | 26 | IL2CPP does not support marshaling delegates that point to instance methods to native code. |
10 | 27 | The method we're attempting to marshal is: UnityCustomTextureRenderer.CustomTextureRenderer::TextureUpdateCallback |
11 | 28 | UnityCustomTextureRenderer.CustomTextureRenderer.Update () (at <00000000000000000000000000000000>:0) |
12 | 29 | UnityCustomTextureRenderer.Samples.Test.Update () (at <00000000000000000000000000000000>:0) |
13 | 30 | ``` |
14 | | -``` |
15 | | -NotSupportedException: |
16 | | -IL2CPP does not support marshaling delegates that point to instance methods to native code. |
17 | | -The method we're attempting to marshal is: UnityCustomTextureRenderer.NonBlockingCustomTextureRenderer::TextureUpdateCallback |
18 | | -UnityCustomTextureRenderer.NonBlockingCustomTextureRenderer.Update () (at <00000000000000000000000000000000>:0) |
19 | | -UnityCustomTextureRenderer.Samples.Test.Update () (at <00000000000000000000000000000000>:0) |
20 | | -``` |
21 | 31 |
|
22 | 32 | ## Tested Environment |
23 | 33 | - Unity 2020.3.27f1 |
|
0 commit comments