├── .editorconfig ├── .github └── FUNDING.yml ├── .gitignore ├── Plugins.meta ├── Plugins ├── Makefile ├── Makefile.meta ├── build.meta ├── build │ ├── Android.meta │ ├── Android │ │ ├── arm32.meta │ │ ├── arm32 │ │ │ ├── libtexture_async_apply.so │ │ │ └── libtexture_async_apply.so.meta │ │ ├── arm64.meta │ │ ├── arm64 │ │ │ ├── libtexture_async_apply.so │ │ │ └── libtexture_async_apply.so.meta │ │ ├── x86.meta │ │ ├── x86 │ │ │ ├── libtexture_async_apply.so │ │ │ └── libtexture_async_apply.so.meta │ │ ├── x86_64.meta │ │ └── x86_64 │ │ │ ├── libtexture_async_apply.so │ │ │ └── libtexture_async_apply.so.meta │ ├── Linux.meta │ ├── Linux │ │ ├── x86_64.meta │ │ └── x86_64 │ │ │ ├── libtexture_async_apply.so │ │ │ └── libtexture_async_apply.so.meta │ ├── Windows.meta │ ├── Windows │ │ ├── x86.meta │ │ ├── x86 │ │ │ ├── texture_async_apply.dll │ │ │ └── texture_async_apply.dll.meta │ │ ├── x86_64.meta │ │ └── x86_64 │ │ │ ├── texture_async_apply.dll │ │ │ └── texture_async_apply.dll.meta │ ├── macOS.meta │ └── macOS │ │ ├── libtexture_async_apply.dylib │ │ └── libtexture_async_apply.dylib.meta ├── src.meta ├── src │ ├── .clangd │ ├── IUnityGraphics.h │ ├── IUnityGraphics.h.meta │ ├── IUnityInterface.h │ ├── IUnityInterface.h.meta │ ├── IUnityRenderingExtensions.h │ ├── IUnityRenderingExtensions.h.meta │ ├── texture_async_apply.cpp │ └── texture_async_apply.cpp.meta └── tools~ │ ├── Dockerfile.build.android │ ├── Dockerfile.build.linux │ ├── Dockerfile.build.webgl │ └── Dockerfile.build.windows ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── Gilzoide.TextureApplyAsync.asmdef ├── Gilzoide.TextureApplyAsync.asmdef.meta ├── Internal.meta ├── Internal │ ├── NativeBridge.cs │ ├── NativeBridge.cs.meta │ ├── TextureAsyncApplier.cs │ └── TextureAsyncApplier.cs.meta ├── TextureApplyAsyncHandle.cs └── TextureApplyAsyncHandle.cs.meta ├── Samples~ ├── PlasmaColorJob.meta ├── PlasmaColorJob │ ├── Gilzoide.TextureAsyncApply.PlasmaColorJob.asmdef │ ├── Gilzoide.TextureAsyncApply.PlasmaColorJob.asmdef.meta │ ├── PlasmaColorJob.unity │ ├── PlasmaColorJob.unity.meta │ ├── PlasmaTextureAsyncUpdater.cs │ └── PlasmaTextureAsyncUpdater.cs.meta ├── RandomColors.meta └── RandomColors │ ├── Gilzoide.TextureAsyncApply.RandomColors.asmdef │ ├── Gilzoide.TextureAsyncApply.RandomColors.asmdef.meta │ ├── RandomColors.unity │ ├── RandomColors.unity.meta │ ├── RandomTextureAsyncUpdater.cs │ └── RandomTextureAsyncUpdater.cs.meta ├── UNLICENSE ├── UNLICENSE.meta ├── package.json └── package.json.meta /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | 9 | [*.{asmdef,cs}] 10 | indent_style = space 11 | indent_size = 4 12 | 13 | [Makefile] 14 | indent_style = tab 15 | indent_size = 8 16 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [gilzoide] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: gilzoide # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: gilzoide # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | polar: # Replace with a single Polar username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Samples 2 | Samples.meta -------------------------------------------------------------------------------- /Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43fd0844331bc48fc9f8f2f478f47d47 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/Makefile: -------------------------------------------------------------------------------- 1 | STRIP ?= strip 2 | EMCXX ?= em++ 3 | SED ?= sed 4 | AR ?= ar 5 | 6 | ANDROID_NDK_ROOT ?= 7 | 8 | LINKFLAGS += -shared 9 | CXXFLAGS += -std=c++11 10 | ifeq ($(DEBUG),1) 11 | CXXFLAGS += -O0 -g 12 | else 13 | CXXFLAGS += -O2 14 | endif 15 | 16 | BUILD_DIRS = \ 17 | build/Windows/x86_64 build/Windows/x86 \ 18 | build/Linux/x86_64 \ 19 | build/macOS build/iOS build/tvOS build/visionOS \ 20 | build/Android/arm64 build/Android/arm32 build/Android/x86 build/Android/x86_64 \ 21 | build/WebGL 22 | 23 | # Misc 24 | $(BUILD_DIRS): 25 | mkdir -p $@ 26 | 27 | %/texture_async_apply.dll: src/texture_async_apply.cpp | % 28 | $(CXX) -o $@ $< $(CXXFLAGS) $(LINKFLAGS) 29 | $(STRIP) -x $@ 30 | 31 | %/libtexture_async_apply.so: CXXFLAGS += -fPIC 32 | %/libtexture_async_apply.so: src/texture_async_apply.cpp | % 33 | $(CXX) -o $@ $< $(CXXFLAGS) $(LINKFLAGS) 34 | $(STRIP) -x $@ 35 | 36 | %/libtexture_async_apply.dylib: src/texture_async_apply.cpp | % 37 | $(CXX) -o $@ $< $(CXXFLAGS) $(LINKFLAGS) 38 | $(STRIP) -x $@ 39 | 40 | %/texture_async_apply.o: src/texture_async_apply.cpp | % 41 | $(CXX) -c -o $@ $< $(CXXFLAGS) 42 | 43 | %/libtexture_async_apply.a: %/texture_async_apply.o | % 44 | $(AR) r $@ $< 45 | $(STRIP) -x $@ 46 | 47 | # Linux 48 | build/Linux/x86/libtexture_async_apply.so: CXXFLAGS += -m32 49 | 50 | # macOS 51 | build/macOS/libtexture_async_apply.dylib: CXXFLAGS += -arch x86_64 -arch arm64 52 | 53 | # Android 54 | check-ndk-root: 55 | ifndef ANDROID_NDK_ROOT 56 | $(error ANDROID_NDK_ROOT must be set for Android builds!) 57 | endif 58 | 59 | build/Android/%/libtexture_async_apply.so: CXXFLAGS += -static-libstdc++ 60 | build/Android/%/libtexture_async_apply.so: STRIP = $(wildcard $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/*/bin/llvm-strip) 61 | 62 | build/Android/arm64/libtexture_async_apply.so: CXX = $(wildcard $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/*/bin/aarch64-linux-android21-clang++) 63 | build/Android/arm64/libtexture_async_apply.so: check-ndk-root 64 | build/Android/arm32/libtexture_async_apply.so: CXX = $(wildcard $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/*/bin/armv7a-linux-androideabi21-clang++) 65 | build/Android/arm32/libtexture_async_apply.so: check-ndk-root 66 | build/Android/x86_64/libtexture_async_apply.so: CXX = $(wildcard $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/*/bin/x86_64-linux-android21-clang++) 67 | build/Android/x86_64/libtexture_async_apply.so: check-ndk-root 68 | build/Android/x86/libtexture_async_apply.so: CXX = $(wildcard $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/*/bin/i686-linux-android21-clang++) 69 | build/Android/x86/libtexture_async_apply.so: check-ndk-root 70 | 71 | # WebGL 72 | build/WebGL/texture_async_apply.bc: src/texture_async_apply.cpp | build/WebGL 73 | $(EMCXX) -o $@ -c $< $(CXXFLAGS) -emit-llvm 74 | 75 | # Targets 76 | windows-x86_64: build/Windows/x86_64/texture_async_apply.dll 77 | windows-x86: build/Windows/x86/texture_async_apply.dll 78 | all-windows: windows-x86_64 windows-x86 79 | 80 | windows-mingw-x86_64: CXX = x86_64-w64-mingw32-c++ 81 | windows-mingw-x86_64: STRIP = x86_64-w64-mingw32-strip 82 | windows-mingw-x86_64: LINKFLAGS += -static-libgcc -static-libstdc++ -static 83 | windows-mingw-x86_64: build/Windows/x86_64/texture_async_apply.dll 84 | 85 | windows-mingw-x86: CXX = i686-w64-mingw32-c++ 86 | windows-mingw-x86: STRIP = i686-w64-mingw32-strip 87 | windows-mingw-x86: LINKFLAGS += -static-libgcc -static-libstdc++ -static 88 | windows-mingw-x86: build/Windows/x86/texture_async_apply.dll 89 | all-windows-mingw: windows-mingw-x86_64 windows-mingw-x86 90 | 91 | linux-x86_64: build/Linux/x86_64/libtexture_async_apply.so 92 | all-linux: linux-x86_64 93 | 94 | macos-universal: build/macOS/libtexture_async_apply.dylib 95 | all-apple: macos-universal 96 | 97 | android-arm64: build/Android/arm64/libtexture_async_apply.so 98 | android-arm32: build/Android/arm32/libtexture_async_apply.so 99 | android-x86_64: build/Android/x86_64/libtexture_async_apply.so 100 | android-x86: build/Android/x86/libtexture_async_apply.so 101 | all-android: android-arm64 android-arm32 android-x86_64 android-x86 102 | 103 | webgl: build/WebGL/texture_async_apply.bc 104 | all-webgl: webgl 105 | 106 | # Dockerized builds 107 | docker-all-android: 108 | docker build -f tools~/Dockerfile.build.android -t gilzoide-texture-async-apply-build-android:latest . 109 | docker run --rm -v "$(CURDIR)":/src -w /src --platform=linux/amd64 gilzoide-texture-async-apply-build-android:latest make all-android 110 | docker-all-linux: 111 | docker build -f tools~/Dockerfile.build.linux -t gilzoide-texture-async-apply-build-linux:latest . 112 | docker run --rm -v "$(CURDIR)":/src -w /src --platform=linux/amd64 gilzoide-texture-async-apply-build-linux:latest make all-linux 113 | docker-all-webgl: 114 | docker build -f tools~/Dockerfile.build.webgl -t gilzoide-texture-async-apply-build-webgl:latest . 115 | docker run --rm -v "$(CURDIR)":/src -w /src gilzoide-texture-async-apply-build-webgl:latest make all-webgl 116 | docker-all-windows: 117 | docker build -f tools~/Dockerfile.build.windows -t gilzoide-texture-async-apply-build-windows:latest . 118 | docker run --rm -v "$(CURDIR)":/src -w /src gilzoide-texture-async-apply-build-windows:latest make all-windows-mingw 119 | -------------------------------------------------------------------------------- /Plugins/Makefile.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2827b5f7520d94a0daf5a7829a830431 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugins/build.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e786b6e970894211869b17537ecb98e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8903da620ec0410d8393dfe16a3e10b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android/arm32.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a54b8fa36841404f97c93e273b158bc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android/arm32/libtexture_async_apply.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Android/arm32/libtexture_async_apply.so -------------------------------------------------------------------------------- /Plugins/build/Android/arm32/libtexture_async_apply.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9be7728f5d564d14b40616a4127a9b0 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: AnyOS 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: None 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: None 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: None 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/Android/arm64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1c4bc21ffc3d419bacea06f3f909874 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android/arm64/libtexture_async_apply.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Android/arm64/libtexture_async_apply.so -------------------------------------------------------------------------------- /Plugins/build/Android/arm64/libtexture_async_apply.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37a371937d3964d9da95feceeb604c7b 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: ARM64 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: AnyOS 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: None 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: None 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: None 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/Android/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a89e3a65416b24ab5a5a9482307b8946 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android/x86/libtexture_async_apply.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Android/x86/libtexture_async_apply.so -------------------------------------------------------------------------------- /Plugins/build/Android/x86/libtexture_async_apply.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fce118ecfaf594e0daf9e4b8347a9fbd 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: X86 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: AnyOS 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: None 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: None 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: None 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/Android/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1137a8c14d83a43eea4c45e87e6d4473 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Android/x86_64/libtexture_async_apply.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Android/x86_64/libtexture_async_apply.so -------------------------------------------------------------------------------- /Plugins/build/Android/x86_64/libtexture_async_apply.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6454549047f14a319bd52f49817a4aa 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: X86_64 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: AnyOS 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: None 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: None 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: None 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9750374724330445abe8da768ea8c454 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Linux/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab5a9c3e54197482ab06066fa4a28ac8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Linux/x86_64/libtexture_async_apply.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Linux/x86_64/libtexture_async_apply.so -------------------------------------------------------------------------------- /Plugins/build/Linux/x86_64/libtexture_async_apply.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f013aeb85ee7941e3acd9961093e52b3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 1 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: ARMv7 32 | - first: 33 | Any: 34 | second: 35 | enabled: 0 36 | settings: {} 37 | - first: 38 | Editor: Editor 39 | second: 40 | enabled: 1 41 | settings: 42 | CPU: x86_64 43 | DefaultValueInitialized: true 44 | OS: Linux 45 | - first: 46 | Standalone: Linux64 47 | second: 48 | enabled: 1 49 | settings: 50 | CPU: AnyCPU 51 | - first: 52 | Standalone: OSXUniversal 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: AnyCPU 63 | - first: 64 | Standalone: Win64 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: AnyCPU 69 | - first: 70 | iPhone: iOS 71 | second: 72 | enabled: 0 73 | settings: 74 | AddToEmbeddedBinaries: false 75 | CPU: AnyCPU 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /Plugins/build/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f407a491ae6c4fbba620590ec0d85e7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Windows/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc4e73925bd984d6abf22b104d7c0644 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Windows/x86/texture_async_apply.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Windows/x86/texture_async_apply.dll -------------------------------------------------------------------------------- /Plugins/build/Windows/x86/texture_async_apply.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db2898c79ff2c412a89d6880f6f7562d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 0 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: Windows 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 1 53 | settings: 54 | CPU: AnyCPU 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 1 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 1 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/Windows/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 696775535468c4a3883ae7c89f8dd969 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/Windows/x86_64/texture_async_apply.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/Windows/x86_64/texture_async_apply.dll -------------------------------------------------------------------------------- /Plugins/build/Windows/x86_64/texture_async_apply.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e7bad6df87784d83aab347e8f752875 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 0 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 1 45 | settings: 46 | CPU: x86_64 47 | DefaultValueInitialized: true 48 | OS: Windows 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 1 53 | settings: 54 | CPU: AnyCPU 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 1 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 1 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/build/macOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f80134c639cbc421f9fa8e2fccf66b89 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/build/macOS/libtexture_async_apply.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gilzoide/unity-texture-apply-async/b90d644623da4fac689201ac49d63fee231a78eb/Plugins/build/macOS/libtexture_async_apply.dylib -------------------------------------------------------------------------------- /Plugins/build/macOS/libtexture_async_apply.dylib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80b8d28bec2674079a3701ad51e077d3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 0 23 | Exclude VisionOS: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 1 28 | Exclude tvOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | AndroidSharedLibraryType: Executable 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 1 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: OSX 49 | - first: 50 | Standalone: Linux64 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: AnyCPU 55 | - first: 56 | Standalone: OSXUniversal 57 | second: 58 | enabled: 1 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Standalone: Win 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Win64 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | VisionOS: VisionOS 75 | second: 76 | enabled: 0 77 | settings: 78 | AddToEmbeddedBinaries: false 79 | CPU: ARM64 80 | CompileFlags: 81 | FrameworkDependencies: 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | - first: 92 | tvOS: tvOS 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: AnyCPU 97 | CompileFlags: 98 | FrameworkDependencies: 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Plugins/src.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0aee73bd9700440db9fee684c885a3d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/src/.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | Add: 3 | - -std=c++11 -------------------------------------------------------------------------------- /Plugins/src/IUnityGraphics.h: -------------------------------------------------------------------------------- 1 | // Unity Native Plugin API copyright © 2015 Unity Technologies ApS 2 | // 3 | // Licensed under the Unity Companion License for Unity - dependent projects--see[Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). 4 | // 5 | // Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions. 6 | 7 | #pragma once 8 | #include "IUnityInterface.h" 9 | 10 | // Has to match the GfxDeviceRenderer enum 11 | typedef enum UnityGfxRenderer 12 | { 13 | //kUnityGfxRendererOpenGL = 0, // Legacy OpenGL, removed 14 | //kUnityGfxRendererD3D9 = 1, // Direct3D 9, removed 15 | kUnityGfxRendererD3D11 = 2, // Direct3D 11 16 | kUnityGfxRendererNull = 4, // "null" device (used in batch mode) 17 | kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0 18 | kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.0 19 | //kUnityGfxRendererGXM = 12, // PlayStation Vita, removed 20 | kUnityGfxRendererPS4 = 13, // PlayStation 4 21 | kUnityGfxRendererXboxOne = 14, // Xbox One 22 | kUnityGfxRendererMetal = 16, // iOS Metal 23 | kUnityGfxRendererOpenGLCore = 17, // OpenGL core 24 | kUnityGfxRendererD3D12 = 18, // Direct3D 12 25 | kUnityGfxRendererVulkan = 21, // Vulkan 26 | kUnityGfxRendererNvn = 22, // Nintendo Switch NVN API 27 | kUnityGfxRendererXboxOneD3D12 = 23, // MS XboxOne Direct3D 12 28 | kUnityGfxRendererGameCoreXboxOne = 24, // GameCore Xbox One 29 | kUnityGfxRendererGameCoreXboxSeries = 25, // GameCore XboxSeries 30 | kUnityGfxRendererPS5 = 26, // PS5 31 | kUnityGfxRendererPS5NGGC = 27 // PS5 NGGC 32 | } UnityGfxRenderer; 33 | 34 | typedef enum UnityGfxDeviceEventType 35 | { 36 | kUnityGfxDeviceEventInitialize = 0, 37 | kUnityGfxDeviceEventShutdown = 1, 38 | kUnityGfxDeviceEventBeforeReset = 2, 39 | kUnityGfxDeviceEventAfterReset = 3, 40 | } UnityGfxDeviceEventType; 41 | 42 | typedef void (UNITY_INTERFACE_API * IUnityGraphicsDeviceEventCallback)(UnityGfxDeviceEventType eventType); 43 | 44 | // Should only be used on the rendering thread unless noted otherwise. 45 | UNITY_DECLARE_INTERFACE(IUnityGraphics) 46 | { 47 | UnityGfxRenderer(UNITY_INTERFACE_API * GetRenderer)(); // Thread safe 48 | 49 | // This callback will be called when graphics device is created, destroyed, reset, etc. 50 | // It is possible to miss the kUnityGfxDeviceEventInitialize event in case plugin is loaded at a later time, 51 | // when the graphics device is already created. 52 | void(UNITY_INTERFACE_API * RegisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 53 | void(UNITY_INTERFACE_API * UnregisterDeviceEventCallback)(IUnityGraphicsDeviceEventCallback callback); 54 | int(UNITY_INTERFACE_API * ReserveEventIDRange)(int count); // reserves 'count' event IDs. Plugins should use the result as a base index when issuing events back and forth to avoid event id clashes. 55 | }; 56 | UNITY_REGISTER_INTERFACE_GUID(0x7CBA0A9CA4DDB544ULL, 0x8C5AD4926EB17B11ULL, IUnityGraphics) 57 | 58 | 59 | // Certain Unity APIs (GL.IssuePluginEvent, CommandBuffer.IssuePluginEvent) can callback into native plugins. 60 | // Provide them with an address to a function of this signature. 61 | typedef void (UNITY_INTERFACE_API * UnityRenderingEvent)(int eventId); 62 | typedef void (UNITY_INTERFACE_API * UnityRenderingEventAndData)(int eventId, void* data); 63 | -------------------------------------------------------------------------------- /Plugins/src/IUnityGraphics.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 910f47243bcbb4aa6abfc60b3ce18438 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 0 24 | Exclude WebGL: 0 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 0 28 | Exclude tvOS: 0 29 | - first: 30 | Any: 31 | second: 32 | enabled: 0 33 | settings: {} 34 | - first: 35 | Editor: Editor 36 | second: 37 | enabled: 0 38 | settings: 39 | DefaultValueInitialized: true 40 | - first: 41 | Standalone: Linux64 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: None 46 | - first: 47 | Standalone: OSXUniversal 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | VisionOS: VisionOS 66 | second: 67 | enabled: 1 68 | settings: {} 69 | - first: 70 | WebGL: WebGL 71 | second: 72 | enabled: 1 73 | settings: {} 74 | - first: 75 | iPhone: iOS 76 | second: 77 | enabled: 1 78 | settings: {} 79 | - first: 80 | tvOS: tvOS 81 | second: 82 | enabled: 1 83 | settings: {} 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Plugins/src/IUnityInterface.h: -------------------------------------------------------------------------------- 1 | // Unity Native Plugin API copyright © 2015 Unity Technologies ApS 2 | // 3 | // Licensed under the Unity Companion License for Unity - dependent projects--see[Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). 4 | // 5 | // Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions. 6 | 7 | #pragma once 8 | 9 | // Unity native plugin API 10 | // Compatible with C99 11 | 12 | #if defined(__CYGWIN32__) 13 | #define UNITY_INTERFACE_API __stdcall 14 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 15 | #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY) 16 | #define UNITY_INTERFACE_API __stdcall 17 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 18 | #elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(LUMIN) 19 | #define UNITY_INTERFACE_API 20 | #define UNITY_INTERFACE_EXPORT __attribute__ ((visibility ("default"))) 21 | #else 22 | #define UNITY_INTERFACE_API 23 | #define UNITY_INTERFACE_EXPORT 24 | #endif 25 | 26 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 27 | // IUnityInterface is a registry of interfaces we choose to expose to plugins. 28 | // 29 | // USAGE: 30 | // --------- 31 | // To retrieve an interface a user can do the following from a plugin, assuming they have the header file for the interface: 32 | // 33 | // IMyInterface * ptr = registry->Get(); 34 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 35 | 36 | // Unity Interface GUID 37 | // Ensures global uniqueness. 38 | // 39 | // Template specialization is used to produce a means of looking up a GUID from its interface type at compile time. 40 | // The net result should compile down to passing around the GUID. 41 | // 42 | // UNITY_REGISTER_INTERFACE_GUID should be placed in the header file of any interface definition outside of all namespaces. 43 | // The interface structure and the registration GUID are all that is required to expose the interface to other systems. 44 | struct UnityInterfaceGUID 45 | { 46 | #ifdef __cplusplus 47 | UnityInterfaceGUID(unsigned long long high, unsigned long long low) 48 | : m_GUIDHigh(high) 49 | , m_GUIDLow(low) 50 | { 51 | } 52 | 53 | UnityInterfaceGUID(const UnityInterfaceGUID& other) 54 | { 55 | m_GUIDHigh = other.m_GUIDHigh; 56 | m_GUIDLow = other.m_GUIDLow; 57 | } 58 | 59 | UnityInterfaceGUID& operator=(const UnityInterfaceGUID& other) 60 | { 61 | m_GUIDHigh = other.m_GUIDHigh; 62 | m_GUIDLow = other.m_GUIDLow; 63 | return *this; 64 | } 65 | 66 | bool Equals(const UnityInterfaceGUID& other) const { return m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow == other.m_GUIDLow; } 67 | bool LessThan(const UnityInterfaceGUID& other) const { return m_GUIDHigh < other.m_GUIDHigh || (m_GUIDHigh == other.m_GUIDHigh && m_GUIDLow < other.m_GUIDLow); } 68 | #endif 69 | unsigned long long m_GUIDHigh; 70 | unsigned long long m_GUIDLow; 71 | }; 72 | #ifdef __cplusplus 73 | inline bool operator==(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.Equals(right); } 74 | inline bool operator!=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !left.Equals(right); } 75 | inline bool operator<(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return left.LessThan(right); } 76 | inline bool operator>(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return right.LessThan(left); } 77 | inline bool operator>=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator<(left, right); } 78 | inline bool operator<=(const UnityInterfaceGUID& left, const UnityInterfaceGUID& right) { return !operator>(left, right); } 79 | #else 80 | typedef struct UnityInterfaceGUID UnityInterfaceGUID; 81 | #endif 82 | 83 | 84 | #ifdef __cplusplus 85 | #define UNITY_DECLARE_INTERFACE(NAME) \ 86 | struct NAME : IUnityInterface 87 | 88 | // Generic version of GetUnityInterfaceGUID to allow us to specialize it 89 | // per interface below. The generic version has no actual implementation 90 | // on purpose. 91 | // 92 | // If you get errors about return values related to this method then 93 | // you have forgotten to include UNITY_REGISTER_INTERFACE_GUID with 94 | // your interface, or it is not visible at some point when you are 95 | // trying to retrieve or add an interface. 96 | template 97 | inline const UnityInterfaceGUID GetUnityInterfaceGUID(); 98 | 99 | // This is the macro you provide in your public interface header 100 | // outside of a namespace to allow us to map between type and GUID 101 | // without the user having to worry about it when attempting to 102 | // add or retrieve and interface from the registry. 103 | #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ 104 | template<> \ 105 | inline const UnityInterfaceGUID GetUnityInterfaceGUID() \ 106 | { \ 107 | return UnityInterfaceGUID(HASHH,HASHL); \ 108 | } 109 | 110 | // Same as UNITY_REGISTER_INTERFACE_GUID but allows the interface to live in 111 | // a particular namespace. As long as the namespace is visible at the time you call 112 | // GetUnityInterfaceGUID< INTERFACETYPE >() or you explicitly qualify it in the template 113 | // calls this will work fine, only the macro here needs to have the additional parameter 114 | #define UNITY_REGISTER_INTERFACE_GUID_IN_NAMESPACE(HASHH, HASHL, TYPE, NAMESPACE) \ 115 | const UnityInterfaceGUID TYPE##_GUID(HASHH, HASHL); \ 116 | template<> \ 117 | inline const UnityInterfaceGUID GetUnityInterfaceGUID< NAMESPACE :: TYPE >() \ 118 | { \ 119 | return UnityInterfaceGUID(HASHH,HASHL); \ 120 | } 121 | 122 | // These macros allow for C compatibility in user code. 123 | #define UNITY_GET_INTERFACE_GUID(TYPE) GetUnityInterfaceGUID< TYPE >() 124 | 125 | 126 | #else 127 | #define UNITY_DECLARE_INTERFACE(NAME) \ 128 | typedef struct NAME NAME; \ 129 | struct NAME 130 | 131 | // NOTE: This has the downside that one some compilers it will not get stripped from all compilation units that 132 | // can see a header containing this constant. However, it's only for C compatibility and thus should have 133 | // minimal impact. 134 | #define UNITY_REGISTER_INTERFACE_GUID(HASHH, HASHL, TYPE) \ 135 | const UnityInterfaceGUID TYPE##_GUID = {HASHH, HASHL}; 136 | 137 | // In general namespaces are going to be a problem for C code any interfaces we expose in a namespace are 138 | // not going to be usable from C. 139 | #define UNITY_REGISTER_INTERFACE_GUID_IN_NAMESPACE(HASHH, HASHL, TYPE, NAMESPACE) 140 | 141 | // These macros allow for C compatibility in user code. 142 | #define UNITY_GET_INTERFACE_GUID(TYPE) TYPE##_GUID 143 | #endif 144 | 145 | // Using this in user code rather than INTERFACES->Get() will be C compatible for those places in plugins where 146 | // this may be needed. Unity code itself does not need this. 147 | #define UNITY_GET_INTERFACE(INTERFACES, TYPE) (TYPE*)INTERFACES->GetInterfaceSplit (UNITY_GET_INTERFACE_GUID(TYPE).m_GUIDHigh, UNITY_GET_INTERFACE_GUID(TYPE).m_GUIDLow); 148 | 149 | 150 | #ifdef __cplusplus 151 | struct IUnityInterface 152 | { 153 | }; 154 | #else 155 | typedef void IUnityInterface; 156 | #endif 157 | 158 | 159 | typedef struct IUnityInterfaces 160 | { 161 | // Returns an interface matching the guid. 162 | // Returns nullptr if the given interface is unavailable in the active Unity runtime. 163 | IUnityInterface* (UNITY_INTERFACE_API * GetInterface)(UnityInterfaceGUID guid); 164 | 165 | // Registers a new interface. 166 | void(UNITY_INTERFACE_API * RegisterInterface)(UnityInterfaceGUID guid, IUnityInterface * ptr); 167 | 168 | // Split APIs for C 169 | IUnityInterface* (UNITY_INTERFACE_API * GetInterfaceSplit)(unsigned long long guidHigh, unsigned long long guidLow); 170 | void(UNITY_INTERFACE_API * RegisterInterfaceSplit)(unsigned long long guidHigh, unsigned long long guidLow, IUnityInterface * ptr); 171 | 172 | #ifdef __cplusplus 173 | // Helper for GetInterface. 174 | template 175 | INTERFACE* Get() 176 | { 177 | return static_cast(GetInterface(GetUnityInterfaceGUID())); 178 | } 179 | 180 | // Helper for RegisterInterface. 181 | template 182 | void Register(IUnityInterface* ptr) 183 | { 184 | RegisterInterface(GetUnityInterfaceGUID(), ptr); 185 | } 186 | 187 | #endif 188 | } IUnityInterfaces; 189 | 190 | 191 | #ifdef __cplusplus 192 | extern "C" { 193 | #endif 194 | 195 | // If exported by a plugin, this function will be called when the plugin is loaded. 196 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginLoad(IUnityInterfaces* unityInterfaces); 197 | // If exported by a plugin, this function will be called when the plugin is about to be unloaded. 198 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload(); 199 | 200 | #ifdef __cplusplus 201 | } 202 | #endif 203 | 204 | struct RenderSurfaceBase; 205 | typedef struct RenderSurfaceBase* UnityRenderBuffer; 206 | typedef unsigned int UnityTextureID; 207 | -------------------------------------------------------------------------------- /Plugins/src/IUnityInterface.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25034896b966f46609169c367baf2a9b 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 0 24 | Exclude WebGL: 0 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 0 28 | Exclude tvOS: 0 29 | - first: 30 | Any: 31 | second: 32 | enabled: 0 33 | settings: {} 34 | - first: 35 | Editor: Editor 36 | second: 37 | enabled: 0 38 | settings: 39 | DefaultValueInitialized: true 40 | - first: 41 | Standalone: Linux64 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: None 46 | - first: 47 | Standalone: OSXUniversal 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | VisionOS: VisionOS 66 | second: 67 | enabled: 1 68 | settings: {} 69 | - first: 70 | WebGL: WebGL 71 | second: 72 | enabled: 1 73 | settings: {} 74 | - first: 75 | iPhone: iOS 76 | second: 77 | enabled: 1 78 | settings: {} 79 | - first: 80 | tvOS: tvOS 81 | second: 82 | enabled: 1 83 | settings: {} 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Plugins/src/IUnityRenderingExtensions.h: -------------------------------------------------------------------------------- 1 | // Unity Native Plugin API copyright © 2015 Unity Technologies ApS 2 | // 3 | // Licensed under the Unity Companion License for Unity - dependent projects--see[Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). 4 | // 5 | // Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions. 6 | 7 | #pragma once 8 | 9 | 10 | #include "IUnityGraphics.h" 11 | 12 | /* 13 | Low-level Native Plugin Rendering Extensions 14 | ============================================ 15 | 16 | On top of the Low-level native plugin interface, Unity also supports low level rendering extensions that can receive callbacks when certain events happen. 17 | This is mostly used to implement and control low-level rendering in your plugin and enable it to work with Unity’s multithreaded rendering. 18 | 19 | Due to the low-level nature of this extension the plugin might need to be preloaded before the devices get created. 20 | Currently the convention is name-based namely the plugin name must be prefixed by “GfxPlugin”. Example: GfxPluginMyFancyNativePlugin. 21 | 22 | 23 | // Native plugin code example 24 | 25 | enum PluginCustomCommands 26 | { 27 | kPluginCustomCommandDownscale = kUnityRenderingExtUserEventsStart, 28 | kPluginCustomCommandUpscale, 29 | 30 | // insert your own events here 31 | 32 | kPluginCustomCommandCount 33 | }; 34 | 35 | static IUnityInterfaces* s_UnityInterfaces = NULL; 36 | 37 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API 38 | UnityPluginLoad(IUnityInterfaces* unityInterfaces) 39 | { 40 | // initialization code here... 41 | } 42 | 43 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API 44 | UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data) 45 | { 46 | switch (event) 47 | { 48 | case kUnityRenderingExtEventBeforeDrawCall: 49 | // do some stuff 50 | break; 51 | case kUnityRenderingExtEventAfterDrawCall: 52 | // undo some stuff 53 | break; 54 | case kPluginCustomCommandDownscale: 55 | // downscale some stuff 56 | break; 57 | case kPluginCustomCommandUpscale: 58 | // upscale some stuff 59 | break; 60 | } 61 | } 62 | 63 | */ 64 | 65 | 66 | // These events will be propagated to all plugins that implement void UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data); 67 | 68 | typedef enum UnityRenderingExtEventType 69 | { 70 | kUnityRenderingExtEventSetStereoTarget, // issued during SetStereoTarget and carrying the current 'eye' index as parameter 71 | kUnityRenderingExtEventSetStereoEye, // issued during stereo rendering at the beginning of each eye's rendering loop. It carries the current 'eye' index as parameter 72 | kUnityRenderingExtEventStereoRenderingDone, // issued after the rendering has finished 73 | kUnityRenderingExtEventBeforeDrawCall, // issued during BeforeDrawCall and carrying UnityRenderingExtBeforeDrawCallParams as parameter 74 | kUnityRenderingExtEventAfterDrawCall, // issued during AfterDrawCall. This event doesn't carry any parameters 75 | kUnityRenderingExtEventCustomGrab, // issued during GrabIntoRenderTexture since we can't simply copy the resources 76 | // when custom rendering is used - we need to let plugin handle this. It carries over 77 | // a UnityRenderingExtCustomBlitParams params = { X, source, dest, 0, 0 } ( X means it's irrelevant ) 78 | kUnityRenderingExtEventCustomBlit, // issued by plugin to insert custom blits. It carries over UnityRenderingExtCustomBlitParams as param. 79 | kUnityRenderingExtEventUpdateTextureBegin, // Deprecated. 80 | kUnityRenderingExtEventUpdateTextureEnd, // Deprecated. 81 | kUnityRenderingExtEventUpdateTextureBeginV1 = kUnityRenderingExtEventUpdateTextureBegin, // Deprecated. Issued to update a texture. It carries over UnityRenderingExtTextureUpdateParamsV1 82 | kUnityRenderingExtEventUpdateTextureEndV1 = kUnityRenderingExtEventUpdateTextureEnd, // Deprecated. Issued to signal the plugin that the texture update has finished. It carries over the same UnityRenderingExtTextureUpdateParamsV1 as kUnityRenderingExtEventUpdateTextureBeginV1 83 | kUnityRenderingExtEventUpdateTextureBeginV2, // Issued to update a texture. It carries over UnityRenderingExtTextureUpdateParamsV2 84 | kUnityRenderingExtEventUpdateTextureEndV2, // Issued to signal the plugin that the texture update has finished. It carries over the same UnityRenderingExtTextureUpdateParamsV2 as kUnityRenderingExtEventUpdateTextureBeginV2 85 | 86 | // keep this last 87 | kUnityRenderingExtEventCount, 88 | kUnityRenderingExtUserEventsStart = kUnityRenderingExtEventCount 89 | } UnityRenderingExtEventType; 90 | 91 | 92 | typedef enum UnityRenderingExtCustomBlitCommands 93 | { 94 | kUnityRenderingExtCustomBlitVRFlush, // This event is mostly used in multi GPU configurations ( SLI, etc ) in order to allow the plugin to flush all GPU's targets 95 | 96 | // keep this last 97 | kUnityRenderingExtCustomBlitCount, 98 | kUnityRenderingExtUserCustomBlitStart = kUnityRenderingExtCustomBlitCount 99 | } UnityRenderingExtCustomBlitCommands; 100 | 101 | /* 102 | This will be propagated to all plugins implementing UnityRenderingExtQuery. 103 | */ 104 | typedef enum UnityRenderingExtQueryType 105 | { 106 | kUnityRenderingExtQueryOverrideViewport = 1 << 0, // The plugin handles setting up the viewport rects. Unity will skip its internal SetViewport calls 107 | kUnityRenderingExtQueryOverrideScissor = 1 << 1, // The plugin handles setting up the scissor rects. Unity will skip its internal SetScissor calls 108 | kUnityRenderingExtQueryOverrideVROcclussionMesh = 1 << 2, // The plugin handles its own VR occlusion mesh rendering. Unity will skip rendering its internal VR occlusion mask 109 | kUnityRenderingExtQueryOverrideVRSinglePass = 1 << 3, // The plugin uses its own single pass stereo technique. Unity will only traverse and render the render node graph once. 110 | // and it will clear the whole render target not just per-eye on demand. 111 | kUnityRenderingExtQueryKeepOriginalDoubleWideWidth_DEPRECATED = 1 << 4, // Instructs unity to keep the original double wide width. By default unity will try and have a power-of-two width for mip-mapping requirements. 112 | kUnityRenderingExtQueryRequestVRFlushCallback = 1 << 5, // Instructs unity to provide callbacks when the VR eye textures need flushing. Useful for multi GPU synchronization. 113 | kUnityRenderingExtQueryOverridePresentFrame = 1 << 6, // The plugin handles it's own SwapChain Present. Unity will skip its internal Present calls 114 | } UnityRenderingExtQueryType; 115 | 116 | 117 | typedef enum UnityRenderingExtTextureFormat 118 | { 119 | kUnityRenderingExtFormatNone = 0, kUnityRenderingExtFormatFirst = kUnityRenderingExtFormatNone, 120 | 121 | // sRGB formats 122 | kUnityRenderingExtFormatR8_SRGB, 123 | kUnityRenderingExtFormatR8G8_SRGB, 124 | kUnityRenderingExtFormatR8G8B8_SRGB, 125 | kUnityRenderingExtFormatR8G8B8A8_SRGB, 126 | 127 | // 8 bit integer formats 128 | kUnityRenderingExtFormatR8_UNorm, 129 | kUnityRenderingExtFormatR8G8_UNorm, 130 | kUnityRenderingExtFormatR8G8B8_UNorm, 131 | kUnityRenderingExtFormatR8G8B8A8_UNorm, 132 | kUnityRenderingExtFormatR8_SNorm, 133 | kUnityRenderingExtFormatR8G8_SNorm, 134 | kUnityRenderingExtFormatR8G8B8_SNorm, 135 | kUnityRenderingExtFormatR8G8B8A8_SNorm, 136 | kUnityRenderingExtFormatR8_UInt, 137 | kUnityRenderingExtFormatR8G8_UInt, 138 | kUnityRenderingExtFormatR8G8B8_UInt, 139 | kUnityRenderingExtFormatR8G8B8A8_UInt, 140 | kUnityRenderingExtFormatR8_SInt, 141 | kUnityRenderingExtFormatR8G8_SInt, 142 | kUnityRenderingExtFormatR8G8B8_SInt, 143 | kUnityRenderingExtFormatR8G8B8A8_SInt, 144 | 145 | // 16 bit integer formats 146 | kUnityRenderingExtFormatR16_UNorm, 147 | kUnityRenderingExtFormatR16G16_UNorm, 148 | kUnityRenderingExtFormatR16G16B16_UNorm, 149 | kUnityRenderingExtFormatR16G16B16A16_UNorm, 150 | kUnityRenderingExtFormatR16_SNorm, 151 | kUnityRenderingExtFormatR16G16_SNorm, 152 | kUnityRenderingExtFormatR16G16B16_SNorm, 153 | kUnityRenderingExtFormatR16G16B16A16_SNorm, 154 | kUnityRenderingExtFormatR16_UInt, 155 | kUnityRenderingExtFormatR16G16_UInt, 156 | kUnityRenderingExtFormatR16G16B16_UInt, 157 | kUnityRenderingExtFormatR16G16B16A16_UInt, 158 | kUnityRenderingExtFormatR16_SInt, 159 | kUnityRenderingExtFormatR16G16_SInt, 160 | kUnityRenderingExtFormatR16G16B16_SInt, 161 | kUnityRenderingExtFormatR16G16B16A16_SInt, 162 | 163 | // 32 bit integer formats 164 | kUnityRenderingExtFormatR32_UInt, 165 | kUnityRenderingExtFormatR32G32_UInt, 166 | kUnityRenderingExtFormatR32G32B32_UInt, 167 | kUnityRenderingExtFormatR32G32B32A32_UInt, 168 | kUnityRenderingExtFormatR32_SInt, 169 | kUnityRenderingExtFormatR32G32_SInt, 170 | kUnityRenderingExtFormatR32G32B32_SInt, 171 | kUnityRenderingExtFormatR32G32B32A32_SInt, 172 | 173 | // HDR formats 174 | kUnityRenderingExtFormatR16_SFloat, 175 | kUnityRenderingExtFormatR16G16_SFloat, 176 | kUnityRenderingExtFormatR16G16B16_SFloat, 177 | kUnityRenderingExtFormatR16G16B16A16_SFloat, 178 | kUnityRenderingExtFormatR32_SFloat, 179 | kUnityRenderingExtFormatR32G32_SFloat, 180 | kUnityRenderingExtFormatR32G32B32_SFloat, 181 | kUnityRenderingExtFormatR32G32B32A32_SFloat, 182 | 183 | // Luminance and Alpha format 184 | kUnityRenderingExtFormatL8_UNorm, 185 | kUnityRenderingExtFormatA8_UNorm, 186 | kUnityRenderingExtFormatA16_UNorm, 187 | 188 | // BGR formats 189 | kUnityRenderingExtFormatB8G8R8_SRGB, 190 | kUnityRenderingExtFormatB8G8R8A8_SRGB, 191 | kUnityRenderingExtFormatB8G8R8_UNorm, 192 | kUnityRenderingExtFormatB8G8R8A8_UNorm, 193 | kUnityRenderingExtFormatB8G8R8_SNorm, 194 | kUnityRenderingExtFormatB8G8R8A8_SNorm, 195 | kUnityRenderingExtFormatB8G8R8_UInt, 196 | kUnityRenderingExtFormatB8G8R8A8_UInt, 197 | kUnityRenderingExtFormatB8G8R8_SInt, 198 | kUnityRenderingExtFormatB8G8R8A8_SInt, 199 | 200 | // 16 bit packed formats 201 | kUnityRenderingExtFormatR4G4B4A4_UNormPack16, 202 | kUnityRenderingExtFormatB4G4R4A4_UNormPack16, 203 | kUnityRenderingExtFormatR5G6B5_UNormPack16, 204 | kUnityRenderingExtFormatB5G6R5_UNormPack16, 205 | kUnityRenderingExtFormatR5G5B5A1_UNormPack16, 206 | kUnityRenderingExtFormatB5G5R5A1_UNormPack16, 207 | kUnityRenderingExtFormatA1R5G5B5_UNormPack16, 208 | 209 | // Packed formats 210 | kUnityRenderingExtFormatE5B9G9R9_UFloatPack32, 211 | kUnityRenderingExtFormatB10G11R11_UFloatPack32, 212 | 213 | kUnityRenderingExtFormatA2B10G10R10_UNormPack32, 214 | kUnityRenderingExtFormatA2B10G10R10_UIntPack32, 215 | kUnityRenderingExtFormatA2B10G10R10_SIntPack32, 216 | kUnityRenderingExtFormatA2R10G10B10_UNormPack32, 217 | kUnityRenderingExtFormatA2R10G10B10_UIntPack32, 218 | kUnityRenderingExtFormatA2R10G10B10_SIntPack32, 219 | kUnityRenderingExtFormatA2R10G10B10_XRSRGBPack32, 220 | kUnityRenderingExtFormatA2R10G10B10_XRUNormPack32, 221 | kUnityRenderingExtFormatR10G10B10_XRSRGBPack32, 222 | kUnityRenderingExtFormatR10G10B10_XRUNormPack32, 223 | kUnityRenderingExtFormatA10R10G10B10_XRSRGBPack32, 224 | kUnityRenderingExtFormatA10R10G10B10_XRUNormPack32, 225 | 226 | // ARGB formats... TextureFormat legacy 227 | kUnityRenderingExtFormatA8R8G8B8_SRGB, 228 | kUnityRenderingExtFormatA8R8G8B8_UNorm, 229 | kUnityRenderingExtFormatA32R32G32B32_SFloat, 230 | 231 | // Depth Stencil for formats 232 | kUnityRenderingExtFormatD16_UNorm, 233 | kUnityRenderingExtFormatD24_UNorm, 234 | kUnityRenderingExtFormatD24_UNorm_S8_UInt, 235 | kUnityRenderingExtFormatD32_SFloat, 236 | kUnityRenderingExtFormatD32_SFloat_S8_UInt, 237 | kUnityRenderingExtFormatS8_UInt, 238 | 239 | // Compression formats 240 | kUnityRenderingExtFormatRGBA_DXT1_SRGB, 241 | kUnityRenderingExtFormatRGBA_DXT1_UNorm, 242 | kUnityRenderingExtFormatRGBA_DXT3_SRGB, 243 | kUnityRenderingExtFormatRGBA_DXT3_UNorm, 244 | kUnityRenderingExtFormatRGBA_DXT5_SRGB, 245 | kUnityRenderingExtFormatRGBA_DXT5_UNorm, 246 | kUnityRenderingExtFormatR_BC4_UNorm, 247 | kUnityRenderingExtFormatR_BC4_SNorm, 248 | kUnityRenderingExtFormatRG_BC5_UNorm, 249 | kUnityRenderingExtFormatRG_BC5_SNorm, 250 | kUnityRenderingExtFormatRGB_BC6H_UFloat, 251 | kUnityRenderingExtFormatRGB_BC6H_SFloat, 252 | kUnityRenderingExtFormatRGBA_BC7_SRGB, 253 | kUnityRenderingExtFormatRGBA_BC7_UNorm, 254 | 255 | kUnityRenderingExtFormatRGB_PVRTC_2Bpp_SRGB, 256 | kUnityRenderingExtFormatRGB_PVRTC_2Bpp_UNorm, 257 | kUnityRenderingExtFormatRGB_PVRTC_4Bpp_SRGB, 258 | kUnityRenderingExtFormatRGB_PVRTC_4Bpp_UNorm, 259 | kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_SRGB, 260 | kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_UNorm, 261 | kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_SRGB, 262 | kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_UNorm, 263 | 264 | kUnityRenderingExtFormatRGB_ETC_UNorm, 265 | kUnityRenderingExtFormatRGB_ETC2_SRGB, 266 | kUnityRenderingExtFormatRGB_ETC2_UNorm, 267 | kUnityRenderingExtFormatRGB_A1_ETC2_SRGB, 268 | kUnityRenderingExtFormatRGB_A1_ETC2_UNorm, 269 | kUnityRenderingExtFormatRGBA_ETC2_SRGB, 270 | kUnityRenderingExtFormatRGBA_ETC2_UNorm, 271 | 272 | kUnityRenderingExtFormatR_EAC_UNorm, 273 | kUnityRenderingExtFormatR_EAC_SNorm, 274 | kUnityRenderingExtFormatRG_EAC_UNorm, 275 | kUnityRenderingExtFormatRG_EAC_SNorm, 276 | 277 | kUnityRenderingExtFormatRGBA_ASTC4X4_SRGB, 278 | kUnityRenderingExtFormatRGBA_ASTC4X4_UNorm, 279 | kUnityRenderingExtFormatRGBA_ASTC5X5_SRGB, 280 | kUnityRenderingExtFormatRGBA_ASTC5X5_UNorm, 281 | kUnityRenderingExtFormatRGBA_ASTC6X6_SRGB, 282 | kUnityRenderingExtFormatRGBA_ASTC6X6_UNorm, 283 | kUnityRenderingExtFormatRGBA_ASTC8X8_SRGB, 284 | kUnityRenderingExtFormatRGBA_ASTC8X8_UNorm, 285 | kUnityRenderingExtFormatRGBA_ASTC10X10_SRGB, 286 | kUnityRenderingExtFormatRGBA_ASTC10X10_UNorm, 287 | kUnityRenderingExtFormatRGBA_ASTC12X12_SRGB, 288 | kUnityRenderingExtFormatRGBA_ASTC12X12_UNorm, 289 | 290 | // Video formats 291 | kUnityRenderingExtFormatYUV2, 292 | 293 | // Automatic formats, back-end decides 294 | kUnityRenderingExtFormatDepthAuto_removed_donotuse, 295 | kUnityRenderingExtFormatShadowAuto_removed_donotuse, 296 | kUnityRenderingExtFormatVideoAuto_removed_donotuse, 297 | 298 | // ASTC hdr profile 299 | kUnityRenderingExtFormatRGBA_ASTC4X4_UFloat, 300 | kUnityRenderingExtFormatRGBA_ASTC5X5_UFloat, 301 | kUnityRenderingExtFormatRGBA_ASTC6X6_UFloat, 302 | kUnityRenderingExtFormatRGBA_ASTC8X8_UFloat, 303 | kUnityRenderingExtFormatRGBA_ASTC10X10_UFloat, 304 | kUnityRenderingExtFormatRGBA_ASTC12X12_UFloat, 305 | 306 | kUnityRenderingExtFormatLast = kUnityRenderingExtFormatRGBA_ASTC12X12_UFloat, // Remove? 307 | } UnityRenderingExtTextureFormat; 308 | 309 | 310 | typedef struct UnityRenderingExtBeforeDrawCallParams 311 | { 312 | void* vertexShader; // bound vertex shader (platform dependent) 313 | void* fragmentShader; // bound fragment shader (platform dependent) 314 | void* geometryShader; // bound geometry shader (platform dependent) 315 | void* hullShader; // bound hull shader (platform dependent) 316 | void* domainShader; // bound domain shader (platform dependent) 317 | int eyeIndex; // the index of the current stereo "eye" being currently rendered. 318 | } UnityRenderingExtBeforeDrawCallParams; 319 | 320 | 321 | typedef struct UnityRenderingExtCustomBlitParams 322 | { 323 | UnityTextureID source; // source texture 324 | UnityRenderBuffer destination; // destination surface 325 | unsigned int command; // command for the custom blit - could be any UnityRenderingExtCustomBlitCommands command or custom ones. 326 | unsigned int commandParam; // custom parameters for the command 327 | unsigned int commandFlags; // custom flags for the command 328 | } UnityRenderingExtCustomBlitParams; 329 | 330 | // Deprecated. Use UnityRenderingExtTextureUpdateParamsV2 and CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. 331 | // Only supports DX11, GLES, Metal 332 | typedef struct UnityRenderingExtTextureUpdateParamsV1 333 | { 334 | void* texData; // source data for the texture update. Must be set by the plugin 335 | unsigned int userData; // user defined data. Set by the plugin 336 | 337 | unsigned int textureID; // texture ID of the texture to be updated. 338 | UnityRenderingExtTextureFormat format; // format of the texture to be updated 339 | unsigned int width; // width of the texture 340 | unsigned int height; // height of the texture 341 | unsigned int bpp; // texture bytes per pixel. 342 | } UnityRenderingExtTextureUpdateParamsV1; 343 | 344 | // Deprecated. Use UnityRenderingExtTextureUpdateParamsV2 and CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. 345 | // Only supports DX11, GLES, Metal 346 | typedef UnityRenderingExtTextureUpdateParamsV1 UnityRenderingExtTextureUpdateParams; 347 | 348 | // Type of the "data" parameter passed when callbacks registered with CommandBuffer.IssuePluginCustomTextureUpdateV2 are called. 349 | // Supports DX11, GLES, Metal, and Switch (also possibly PS4, PSVita in the future) 350 | typedef struct UnityRenderingExtTextureUpdateParamsV2 351 | { 352 | void* texData; // source data for the texture update. Must be set by the plugin 353 | intptr_t textureID; // texture ID of the texture to be updated. 354 | unsigned int userData; // user defined data. Set by the plugin 355 | UnityRenderingExtTextureFormat format; // format of the texture to be updated 356 | unsigned int width; // width of the texture 357 | unsigned int height; // height of the texture 358 | unsigned int bpp; // texture bytes per pixel. 359 | } UnityRenderingExtTextureUpdateParamsV2; 360 | 361 | 362 | // Certain Unity APIs (GL.IssuePluginEventAndData, CommandBuffer.IssuePluginEventAndData) can callback into native plugins. 363 | // Provide them with an address to a function of this signature. 364 | typedef void (UNITY_INTERFACE_API * UnityRenderingEventAndData)(int eventId, void* data); 365 | 366 | 367 | #ifdef __cplusplus 368 | extern "C" { 369 | #endif 370 | 371 | // If exported by a plugin, this function will be called for all the events in UnityRenderingExtEventType 372 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data); 373 | // If exported by a plugin, this function will be called to query the plugin for the queries in UnityRenderingExtQueryType 374 | bool UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtQuery(UnityRenderingExtQueryType query); 375 | 376 | #ifdef __cplusplus 377 | } 378 | #endif 379 | -------------------------------------------------------------------------------- /Plugins/src/IUnityRenderingExtensions.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8da3d02a4f7341ce816014023b1630a 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 0 24 | Exclude WebGL: 0 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 0 28 | Exclude tvOS: 0 29 | - first: 30 | Any: 31 | second: 32 | enabled: 0 33 | settings: {} 34 | - first: 35 | Editor: Editor 36 | second: 37 | enabled: 0 38 | settings: 39 | DefaultValueInitialized: true 40 | - first: 41 | Standalone: Linux64 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: None 46 | - first: 47 | Standalone: OSXUniversal 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | VisionOS: VisionOS 66 | second: 67 | enabled: 1 68 | settings: {} 69 | - first: 70 | WebGL: WebGL 71 | second: 72 | enabled: 1 73 | settings: {} 74 | - first: 75 | iPhone: iOS 76 | second: 77 | enabled: 1 78 | settings: {} 79 | - first: 80 | tvOS: tvOS 81 | second: 82 | enabled: 1 83 | settings: {} 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Plugins/src/texture_async_apply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "IUnityInterface.h" 5 | #include "IUnityRenderingExtensions.h" 6 | 7 | 8 | std::unordered_map bufferMap; 9 | unsigned int lastIndex; 10 | 11 | static void event_handler(int eventId, UnityRenderingExtTextureUpdateParamsV2* data) { 12 | if (eventId == kUnityRenderingExtEventUpdateTextureBeginV2) { 13 | auto it = bufferMap.find(data->userData); 14 | if (it != bufferMap.end()) { 15 | data->texData = it->second; 16 | } 17 | } 18 | } 19 | 20 | extern "C" UNITY_INTERFACE_EXPORT void *TextureAsyncApply_event_handler() { 21 | return (void *) &event_handler; 22 | } 23 | 24 | extern "C" UNITY_INTERFACE_EXPORT unsigned int TextureAsyncApply_new(void *buffer) { 25 | bufferMap[++lastIndex] = buffer; 26 | return lastIndex; 27 | } 28 | 29 | extern "C" UNITY_INTERFACE_EXPORT void TextureAsyncApply_dispose(unsigned int index) { 30 | bufferMap.erase(index); 31 | } 32 | -------------------------------------------------------------------------------- /Plugins/src/texture_async_apply.cpp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d493b51f97004e1a9a61327dd5a4cd3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude VisionOS: 0 24 | Exclude WebGL: 0 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 0 28 | Exclude tvOS: 0 29 | - first: 30 | Any: 31 | second: 32 | enabled: 0 33 | settings: {} 34 | - first: 35 | Editor: Editor 36 | second: 37 | enabled: 0 38 | settings: 39 | DefaultValueInitialized: true 40 | - first: 41 | Standalone: Linux64 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: None 46 | - first: 47 | Standalone: OSXUniversal 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | VisionOS: VisionOS 66 | second: 67 | enabled: 1 68 | settings: {} 69 | - first: 70 | WebGL: WebGL 71 | second: 72 | enabled: 1 73 | settings: {} 74 | - first: 75 | iPhone: iOS 76 | second: 77 | enabled: 1 78 | settings: {} 79 | - first: 80 | tvOS: tvOS 81 | second: 82 | enabled: 1 83 | settings: {} 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Plugins/tools~/Dockerfile.build.android: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | FROM --platform=linux/amd64 debian:12-slim 3 | 4 | ARG NDK_VERSION=r26c 5 | 6 | RUN apt-get -qq update \ 7 | && apt-get -qq install -y --no-install-recommends \ 8 | curl \ 9 | unzip \ 10 | make 11 | RUN curl -SLO http://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip 12 | RUN unzip android-ndk-$NDK_VERSION-linux.zip 13 | RUN mv ./android-ndk-$NDK_VERSION /opt/ndk 14 | RUN rm android-ndk-$NDK_VERSION-linux.zip 15 | ENV ANDROID_NDK_ROOT /opt/ndk 16 | -------------------------------------------------------------------------------- /Plugins/tools~/Dockerfile.build.linux: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | FROM --platform=linux/amd64 debian:12-slim 3 | 4 | RUN apt-get -qq update \ 5 | && apt-get -qq install -y --no-install-recommends \ 6 | g++ \ 7 | make 8 | -------------------------------------------------------------------------------- /Plugins/tools~/Dockerfile.build.webgl: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | FROM debian:12-slim 3 | 4 | RUN apt-get -qq update \ 5 | && apt-get -qq install -y --no-install-recommends \ 6 | emscripten \ 7 | make 8 | -------------------------------------------------------------------------------- /Plugins/tools~/Dockerfile.build.windows: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | FROM debian:12-slim 3 | 4 | RUN apt-get -qq update \ 5 | && apt-get -qq install -y --no-install-recommends \ 6 | make \ 7 | g++-mingw-w64-x86-64-win32 g++-mingw-w64-i686-win32 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Texture Apply Async 2 | [![openupm](https://img.shields.io/npm/v/com.gilzoide.texture-apply-async?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gilzoide.texture-apply-async/) 3 | 4 | Alternative to [Texture2D.Apply()](https://docs.unity3d.com/ScriptReference/Texture2D.Apply.html) that doesn't require synchronizing with the render thread, avoiding stalls in the main thread. 5 | 6 | 7 | ## Features 8 | - Asynchronous texture data update in CPU in the render thread, avoiding stalls in the main thread 9 | - Supports Unity's Built-in Render Pipeline as well as Scriptable Render Pipelines (e.g: URP and HDRP). 10 | - To guarante the texture is applied before appearing in the screen: 11 | + In BRP, updates are scheduled in the first Camera's `Camera.onPreRender` event 12 | + In SRP, updates are scheduled in `RenderPipelineManager.beginContextRendering` event 13 | - Supports registering for updates every frame or for a single frame 14 | - Prebuilt for Windows, Linux, macOS and Android 15 | - Built from source in iOS, tvOS, visionOS and WebGL projects 16 | 17 | 18 | ## Caveats 19 | - You should not update the texture's data while the camera/render pipeline is rendering, or else garbage data could be applied to the texture. 20 | 21 | 22 | ## How to install 23 | Either: 24 | - Use the [openupm registry](https://openupm.com/) and install this package using the [openupm-cli](https://github.com/openupm/openupm-cli): 25 | ``` 26 | openupm add com.gilzoide.texture-apply-async 27 | ``` 28 | - Install using the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui-giturl.html) with the following URL: 29 | ``` 30 | https://github.com/gilzoide/unity-texture-apply-async.git#1.2.0 31 | ``` 32 | - Clone this repository or download a snapshot of it directly inside your project's `Assets` or `Packages` folder. 33 | 34 | 35 | ## Samples 36 | - [Random Colors](Samples~/RandomColors): simple sample with a UI that shows random colors. 37 | - [Plasma Color Job](Samples~/PlasmaColorJob): sample scene with a plasma effect UI that is updated using the C# Job System. 38 | 39 | 40 | ## How to use 41 | ```cs 42 | using Gilzoide.TextureApplyAsync; 43 | 44 | // 1. Create a `TextureApplyAsyncHandle` for your texture. 45 | var textureApplyAsyncHandle = new TextureApplyAsyncHandle(myTexture); 46 | 47 | // 2. If you want to update your texture every frame, 48 | // schedule the apply handle to update every frame. 49 | textureApplyAsyncHandle.ScheduleUpdateEveryFrame(); 50 | 51 | // 3. Update the texture data normally. 52 | for (int x = 0; x < myTexture.width; x++) 53 | { 54 | for (int y = 0; y < myTexture.height; y++) 55 | { 56 | myTexture.SetPixel(x, y, Random.ColorHSV()); 57 | } 58 | } 59 | 60 | // 4. If you want to update your texture only once, 61 | // schedule a one-shot update. 62 | textureApplyAsyncHandle.ScheduleUpdateOnce(); 63 | 64 | // 5. Cancel updates if necessary. 65 | // Works for both one-shot and every frame updates. 66 | textureApplyAsyncHandle.CancelUpdates(); 67 | 68 | // 6. If you ever Reinitialize your Texture, make 69 | // sure to Reinitialize your TextureApplyAsyncHandle 70 | // or your app may crash!!! 71 | myTexture.Reinitialize(width, height); 72 | myTexture.Apply(); 73 | textureApplyAsyncHandle.Reinitialize(); 74 | 75 | // 7. Dispose of the `TextureApplyAsyncHandle` when not needed 76 | // anymore, e.g. inside a component's `OnDestroy`. 77 | textureApplyAsyncHandle.Dispose(); 78 | ``` 79 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2007cf3918b3342c6a400d4792ba2b5d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24bc3fb8fc8414902a34a785556705ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Gilzoide.TextureApplyAsync.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Gilzoide.TextureApplyAsync", 3 | "rootNamespace": "Gilzoide.TextureApplyAsync", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": true, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /Runtime/Gilzoide.TextureApplyAsync.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1717f0e842f7648a29c9a1d8e73e52cb 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c841162a41d794a468e7096fe52f44e2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Internal/NativeBridge.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Gilzoide.TextureApplyAsync.Internal 5 | { 6 | internal class NativeBridge 7 | { 8 | #if !UNITY_EDITOR && (UNITY_WEBGL || UNITY_IOS || UNITY_TVOS || UNITY_VISIONOS) 9 | internal const string LibraryName = "__Internal"; 10 | #else 11 | internal const string LibraryName = "texture_async_apply"; 12 | #endif 13 | 14 | [DllImport(LibraryName, EntryPoint = "TextureAsyncApply_event_handler")] 15 | internal static extern IntPtr GetEventHandler(); 16 | internal static readonly IntPtr EventHandler_ptr = GetEventHandler(); 17 | 18 | [DllImport(LibraryName, EntryPoint = "TextureAsyncApply_new")] 19 | internal static extern uint RegisterHandle(IntPtr buffer); 20 | 21 | [DllImport(LibraryName, EntryPoint = "TextureAsyncApply_dispose")] 22 | internal static extern void UnregisterHandle(uint handle); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Runtime/Internal/NativeBridge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 301e1558e1a0c4fea9ec3eee777aec3c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Internal/TextureAsyncApplier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | 6 | namespace Gilzoide.TextureApplyAsync.Internal 7 | { 8 | public static class TextureAsyncApplier 9 | { 10 | private static readonly List _applyHandlesEveryFrame = new(); 11 | private static readonly List _applyHandlesThisFrame = new(); 12 | private static CommandBuffer _commandBuffer; 13 | private static Camera _registeredCamera; 14 | private static int _lastProcessedFrame; 15 | private static bool _isCommandBufferDirty; 16 | private static bool _isOnPreRenderRegistered; 17 | 18 | private static int HandlesCount => _applyHandlesEveryFrame.Count + _applyHandlesThisFrame.Count; 19 | private static bool IsUsingScriptableRenderPipeline => GraphicsSettings.currentRenderPipeline != null; 20 | 21 | public static void ScheduleUpdateEveryFrame(TextureApplyAsyncHandle handle) 22 | { 23 | Register(handle, true); 24 | } 25 | 26 | public static void ScheduleUpdateOnce(TextureApplyAsyncHandle handle) 27 | { 28 | Register(handle, false); 29 | } 30 | 31 | private static void Register(TextureApplyAsyncHandle handle, bool updateEveryFrame) 32 | { 33 | if (handle == null) 34 | { 35 | throw new ArgumentNullException(nameof(handle)); 36 | } 37 | if (!handle.IsValid 38 | || _applyHandlesEveryFrame.Contains(handle) 39 | || (!updateEveryFrame && _applyHandlesThisFrame.Contains(handle))) 40 | { 41 | return; 42 | } 43 | 44 | if (updateEveryFrame) 45 | { 46 | _applyHandlesThisFrame.Remove(handle); 47 | _applyHandlesEveryFrame.Add(handle); 48 | } 49 | else 50 | { 51 | _applyHandlesThisFrame.Add(handle); 52 | } 53 | _isCommandBufferDirty = true; 54 | if (!_isOnPreRenderRegistered) 55 | { 56 | RegisterOnPreRender(); 57 | } 58 | } 59 | 60 | public static void Unregister(TextureApplyAsyncHandle handle) 61 | { 62 | bool removedAnyHandles = _applyHandlesEveryFrame.Remove(handle) || _applyHandlesThisFrame.Remove(handle); 63 | if (removedAnyHandles) 64 | { 65 | _isCommandBufferDirty = true; 66 | if (_isOnPreRenderRegistered && HandlesCount == 0) 67 | { 68 | UnregisterOnPreRender(); 69 | } 70 | } 71 | } 72 | 73 | public static bool IsRegistered(TextureApplyAsyncHandle handle) 74 | { 75 | return _applyHandlesEveryFrame.Contains(handle) || _applyHandlesThisFrame.Contains(handle); 76 | } 77 | 78 | internal static void MarkDirty(TextureApplyAsyncHandle handle) 79 | { 80 | if (!_isCommandBufferDirty) 81 | { 82 | _isCommandBufferDirty = IsRegistered(handle); 83 | } 84 | } 85 | 86 | [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] 87 | private static void InitializeOnLoad() 88 | { 89 | _commandBuffer = new CommandBuffer 90 | { 91 | name = nameof(TextureAsyncApplier), 92 | }; 93 | Application.quitting += Dispose; 94 | } 95 | 96 | private static void Dispose() 97 | { 98 | _applyHandlesEveryFrame.Clear(); 99 | _applyHandlesThisFrame.Clear(); 100 | 101 | UnregisterOnPreRender(); 102 | 103 | _commandBuffer?.Dispose(); 104 | _commandBuffer = null; 105 | } 106 | 107 | private static void RegisterOnPreRender() 108 | { 109 | if (IsUsingScriptableRenderPipeline) 110 | { 111 | RenderPipelineManager.beginContextRendering += CachedOnBeginContextRendering; 112 | } 113 | else 114 | { 115 | Camera.onPreRender += CachedOnPreRender; 116 | } 117 | _isOnPreRenderRegistered = true; 118 | } 119 | 120 | private static void UnregisterOnPreRender() 121 | { 122 | if (IsUsingScriptableRenderPipeline) 123 | { 124 | RenderPipelineManager.beginContextRendering -= CachedOnBeginContextRendering; 125 | } 126 | else 127 | { 128 | Camera.onPreRender -= CachedOnPreRender; 129 | } 130 | if (_registeredCamera && _commandBuffer != null) 131 | { 132 | _registeredCamera.RemoveCommandBuffer(_registeredCamera.GetFirstCameraEvent(), _commandBuffer); 133 | } 134 | _isOnPreRenderRegistered = false; 135 | } 136 | 137 | private static void RebuildCommandBuffer() 138 | { 139 | _commandBuffer.Clear(); 140 | foreach (TextureApplyAsyncHandle handle in _applyHandlesEveryFrame) 141 | { 142 | handle.FillCommandBuffer(_commandBuffer); 143 | } 144 | foreach (TextureApplyAsyncHandle handle in _applyHandlesThisFrame) 145 | { 146 | handle.FillCommandBuffer(_commandBuffer); 147 | } 148 | _isCommandBufferDirty = false; 149 | } 150 | 151 | #region Builtin Render Pipeline 152 | 153 | private static readonly Camera.CameraCallback CachedOnPreRender = OnPreRender; 154 | private static void OnPreRender(Camera camera) 155 | { 156 | int currentFrame = Time.frameCount; 157 | if (currentFrame != _lastProcessedFrame) 158 | { 159 | _lastProcessedFrame = currentFrame; 160 | OnPreRenderFirstCamera(camera); 161 | } 162 | } 163 | 164 | private static void OnPreRenderFirstCamera(Camera camera) 165 | { 166 | if (HandlesCount == 0) 167 | { 168 | UnregisterOnPreRender(); 169 | return; 170 | } 171 | 172 | if (!_isCommandBufferDirty && camera == _registeredCamera) 173 | { 174 | return; 175 | } 176 | 177 | if (_isCommandBufferDirty) 178 | { 179 | RebuildCommandBuffer(); 180 | } 181 | if (_applyHandlesThisFrame.Count > 0) 182 | { 183 | _applyHandlesThisFrame.Clear(); 184 | _isCommandBufferDirty = true; 185 | } 186 | if (_registeredCamera) 187 | { 188 | _registeredCamera.RemoveCommandBuffer(_registeredCamera.GetFirstCameraEvent(), _commandBuffer); 189 | } 190 | camera.AddCommandBuffer(camera.GetFirstCameraEvent(), _commandBuffer); 191 | _registeredCamera = camera; 192 | } 193 | 194 | private static CameraEvent GetFirstCameraEvent(this Camera camera) 195 | { 196 | switch (camera.actualRenderingPath) 197 | { 198 | #pragma warning disable CS0618 // Type or member is obsolete 199 | case RenderingPath.DeferredLighting: 200 | #pragma warning restore CS0618 // Type or member is obsolete 201 | case RenderingPath.DeferredShading: 202 | return CameraEvent.BeforeGBuffer; 203 | 204 | default: 205 | return CameraEvent.BeforeForwardOpaque; 206 | } 207 | } 208 | 209 | #endregion // Builtin Render Pipeline 210 | 211 | #region Scriptable Render Pipeline 212 | 213 | private static readonly Action> CachedOnBeginContextRendering = OnBeginContextRendering; 214 | private static void OnBeginContextRendering(ScriptableRenderContext context, List cameras) 215 | { 216 | if (HandlesCount == 0) 217 | { 218 | UnregisterOnPreRender(); 219 | return; 220 | } 221 | 222 | if (_isCommandBufferDirty) 223 | { 224 | RebuildCommandBuffer(); 225 | } 226 | if (_applyHandlesThisFrame.Count > 0) 227 | { 228 | _applyHandlesThisFrame.Clear(); 229 | _isCommandBufferDirty = true; 230 | } 231 | context.ExecuteCommandBuffer(_commandBuffer); 232 | } 233 | 234 | #endregion // Scriptable Render Pipeline 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /Runtime/Internal/TextureAsyncApplier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95d1165a1ad224bcf83691921e5622c6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/TextureApplyAsyncHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gilzoide.TextureApplyAsync.Internal; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using UnityEngine; 5 | using UnityEngine.Rendering; 6 | 7 | namespace Gilzoide.TextureApplyAsync 8 | { 9 | public class TextureApplyAsyncHandle : IDisposable 10 | { 11 | public uint Id { get; private set; } 12 | public Texture2D Texture { get; private set; } 13 | 14 | public bool IsValid => Id != 0 && Texture; 15 | 16 | public TextureApplyAsyncHandle(Texture2D texture) 17 | { 18 | Texture = texture; 19 | Reinitialize(); 20 | } 21 | 22 | ~TextureApplyAsyncHandle() 23 | { 24 | Dispose(); 25 | } 26 | 27 | public void ScheduleUpdateEveryFrame() 28 | { 29 | TextureAsyncApplier.ScheduleUpdateEveryFrame(this); 30 | } 31 | 32 | public void ScheduleUpdateOnce() 33 | { 34 | TextureAsyncApplier.ScheduleUpdateOnce(this); 35 | } 36 | 37 | public void CancelUpdates() 38 | { 39 | TextureAsyncApplier.Unregister(this); 40 | } 41 | 42 | public void Reinitialize() 43 | { 44 | if (Texture == null) 45 | { 46 | throw new ArgumentNullException(nameof(Texture)); 47 | } 48 | 49 | if (Id != 0) 50 | { 51 | NativeBridge.UnregisterHandle(Id); 52 | } 53 | unsafe 54 | { 55 | Id = NativeBridge.RegisterHandle((IntPtr) Texture.GetRawTextureData().GetUnsafeReadOnlyPtr()); 56 | } 57 | TextureAsyncApplier.MarkDirty(this); 58 | } 59 | 60 | public void FillCommandBuffer(CommandBuffer commandBuffer) 61 | { 62 | if (IsValid) 63 | { 64 | commandBuffer.IssuePluginCustomTextureUpdateV2(NativeBridge.EventHandler_ptr, Texture, Id); 65 | } 66 | } 67 | 68 | public void Dispose() 69 | { 70 | CancelUpdates(); 71 | 72 | NativeBridge.UnregisterHandle(Id); 73 | Id = 0; 74 | 75 | Texture = null; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Runtime/TextureApplyAsyncHandle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 767cd29ef3dc9407094f1361844b3f94 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1165025380be7459e968816bbea0ec15 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/Gilzoide.TextureAsyncApply.PlasmaColorJob.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Gilzoide.TextureAsyncApply.PlasmaColorJob", 3 | "rootNamespace": "", 4 | "references": [ 5 | "Gilzoide.TextureApplyAsync", 6 | "Unity.Burst" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [ 16 | { 17 | "name": "com.unity.burst", 18 | "expression": "", 19 | "define": "HAVE_BURST" 20 | } 21 | ], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/Gilzoide.TextureAsyncApply.PlasmaColorJob.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 547af4e572aab4b3f8fcafe7d941f5c3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/PlasmaColorJob.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 3 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | buildHeightMesh: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &163909897 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 163909898} 135 | - component: {fileID: 163909900} 136 | - component: {fileID: 163909899} 137 | m_Layer: 5 138 | m_Name: Label 139 | m_TagString: Untagged 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!224 &163909898 145 | RectTransform: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 163909897} 151 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 152 | m_LocalPosition: {x: 0, y: 0, z: 0} 153 | m_LocalScale: {x: 1, y: 1, z: 1} 154 | m_ConstrainProportionsScale: 0 155 | m_Children: [] 156 | m_Father: {fileID: 1139637295} 157 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 158 | m_AnchorMin: {x: 0, y: 0} 159 | m_AnchorMax: {x: 1, y: 1} 160 | m_AnchoredPosition: {x: 9, y: -0.5} 161 | m_SizeDelta: {x: -28, y: -3} 162 | m_Pivot: {x: 0.5, y: 0.5} 163 | --- !u!114 &163909899 164 | MonoBehaviour: 165 | m_ObjectHideFlags: 0 166 | m_CorrespondingSourceObject: {fileID: 0} 167 | m_PrefabInstance: {fileID: 0} 168 | m_PrefabAsset: {fileID: 0} 169 | m_GameObject: {fileID: 163909897} 170 | m_Enabled: 1 171 | m_EditorHideFlags: 0 172 | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} 173 | m_Name: 174 | m_EditorClassIdentifier: 175 | m_Material: {fileID: 0} 176 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 177 | m_RaycastTarget: 1 178 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 179 | m_Maskable: 1 180 | m_OnCullStateChanged: 181 | m_PersistentCalls: 182 | m_Calls: [] 183 | m_FontData: 184 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 185 | m_FontSize: 14 186 | m_FontStyle: 0 187 | m_BestFit: 0 188 | m_MinSize: 10 189 | m_MaxSize: 40 190 | m_Alignment: 0 191 | m_AlignByGeometry: 0 192 | m_RichText: 1 193 | m_HorizontalOverflow: 0 194 | m_VerticalOverflow: 0 195 | m_LineSpacing: 1 196 | m_Text: Async 197 | --- !u!222 &163909900 198 | CanvasRenderer: 199 | m_ObjectHideFlags: 0 200 | m_CorrespondingSourceObject: {fileID: 0} 201 | m_PrefabInstance: {fileID: 0} 202 | m_PrefabAsset: {fileID: 0} 203 | m_GameObject: {fileID: 163909897} 204 | m_CullTransparentMesh: 1 205 | --- !u!1 &709874130 206 | GameObject: 207 | m_ObjectHideFlags: 0 208 | m_CorrespondingSourceObject: {fileID: 0} 209 | m_PrefabInstance: {fileID: 0} 210 | m_PrefabAsset: {fileID: 0} 211 | serializedVersion: 6 212 | m_Component: 213 | - component: {fileID: 709874131} 214 | - component: {fileID: 709874133} 215 | - component: {fileID: 709874132} 216 | m_Layer: 5 217 | m_Name: Panel 218 | m_TagString: Untagged 219 | m_Icon: {fileID: 0} 220 | m_NavMeshLayer: 0 221 | m_StaticEditorFlags: 0 222 | m_IsActive: 1 223 | --- !u!224 &709874131 224 | RectTransform: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 709874130} 230 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 231 | m_LocalPosition: {x: 0, y: 0, z: 0} 232 | m_LocalScale: {x: 1, y: 1, z: 1} 233 | m_ConstrainProportionsScale: 0 234 | m_Children: 235 | - {fileID: 1028841917} 236 | - {fileID: 1139637295} 237 | m_Father: {fileID: 1736878525} 238 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 239 | m_AnchorMin: {x: 0, y: 0} 240 | m_AnchorMax: {x: 1, y: 1} 241 | m_AnchoredPosition: {x: 0, y: 0} 242 | m_SizeDelta: {x: 0, y: 0} 243 | m_Pivot: {x: 0.5, y: 0.5} 244 | --- !u!114 &709874132 245 | MonoBehaviour: 246 | m_ObjectHideFlags: 0 247 | m_CorrespondingSourceObject: {fileID: 0} 248 | m_PrefabInstance: {fileID: 0} 249 | m_PrefabAsset: {fileID: 0} 250 | m_GameObject: {fileID: 709874130} 251 | m_Enabled: 1 252 | m_EditorHideFlags: 0 253 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 254 | m_Name: 255 | m_EditorClassIdentifier: 256 | m_Material: {fileID: 0} 257 | m_Color: {r: 1, g: 1, b: 1, a: 0.392} 258 | m_RaycastTarget: 1 259 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 260 | m_Maskable: 1 261 | m_OnCullStateChanged: 262 | m_PersistentCalls: 263 | m_Calls: [] 264 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} 265 | m_Type: 1 266 | m_PreserveAspect: 0 267 | m_FillCenter: 1 268 | m_FillMethod: 4 269 | m_FillAmount: 1 270 | m_FillClockwise: 1 271 | m_FillOrigin: 0 272 | m_UseSpriteMesh: 0 273 | m_PixelsPerUnitMultiplier: 1 274 | --- !u!222 &709874133 275 | CanvasRenderer: 276 | m_ObjectHideFlags: 0 277 | m_CorrespondingSourceObject: {fileID: 0} 278 | m_PrefabInstance: {fileID: 0} 279 | m_PrefabAsset: {fileID: 0} 280 | m_GameObject: {fileID: 709874130} 281 | m_CullTransparentMesh: 1 282 | --- !u!1 &743713333 283 | GameObject: 284 | m_ObjectHideFlags: 0 285 | m_CorrespondingSourceObject: {fileID: 0} 286 | m_PrefabInstance: {fileID: 0} 287 | m_PrefabAsset: {fileID: 0} 288 | serializedVersion: 6 289 | m_Component: 290 | - component: {fileID: 743713334} 291 | - component: {fileID: 743713336} 292 | - component: {fileID: 743713335} 293 | m_Layer: 5 294 | m_Name: Checkmark 295 | m_TagString: Untagged 296 | m_Icon: {fileID: 0} 297 | m_NavMeshLayer: 0 298 | m_StaticEditorFlags: 0 299 | m_IsActive: 1 300 | --- !u!224 &743713334 301 | RectTransform: 302 | m_ObjectHideFlags: 0 303 | m_CorrespondingSourceObject: {fileID: 0} 304 | m_PrefabInstance: {fileID: 0} 305 | m_PrefabAsset: {fileID: 0} 306 | m_GameObject: {fileID: 743713333} 307 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 308 | m_LocalPosition: {x: 0, y: 0, z: 0} 309 | m_LocalScale: {x: 1, y: 1, z: 1} 310 | m_ConstrainProportionsScale: 0 311 | m_Children: [] 312 | m_Father: {fileID: 1817335795} 313 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 314 | m_AnchorMin: {x: 0.5, y: 0.5} 315 | m_AnchorMax: {x: 0.5, y: 0.5} 316 | m_AnchoredPosition: {x: 0, y: 0} 317 | m_SizeDelta: {x: 20, y: 20} 318 | m_Pivot: {x: 0.5, y: 0.5} 319 | --- !u!114 &743713335 320 | MonoBehaviour: 321 | m_ObjectHideFlags: 0 322 | m_CorrespondingSourceObject: {fileID: 0} 323 | m_PrefabInstance: {fileID: 0} 324 | m_PrefabAsset: {fileID: 0} 325 | m_GameObject: {fileID: 743713333} 326 | m_Enabled: 1 327 | m_EditorHideFlags: 0 328 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 329 | m_Name: 330 | m_EditorClassIdentifier: 331 | m_Material: {fileID: 0} 332 | m_Color: {r: 1, g: 1, b: 1, a: 1} 333 | m_RaycastTarget: 1 334 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 335 | m_Maskable: 1 336 | m_OnCullStateChanged: 337 | m_PersistentCalls: 338 | m_Calls: [] 339 | m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} 340 | m_Type: 0 341 | m_PreserveAspect: 0 342 | m_FillCenter: 1 343 | m_FillMethod: 4 344 | m_FillAmount: 1 345 | m_FillClockwise: 1 346 | m_FillOrigin: 0 347 | m_UseSpriteMesh: 0 348 | m_PixelsPerUnitMultiplier: 1 349 | --- !u!222 &743713336 350 | CanvasRenderer: 351 | m_ObjectHideFlags: 0 352 | m_CorrespondingSourceObject: {fileID: 0} 353 | m_PrefabInstance: {fileID: 0} 354 | m_PrefabAsset: {fileID: 0} 355 | m_GameObject: {fileID: 743713333} 356 | m_CullTransparentMesh: 1 357 | --- !u!1 &748227656 358 | GameObject: 359 | m_ObjectHideFlags: 0 360 | m_CorrespondingSourceObject: {fileID: 0} 361 | m_PrefabInstance: {fileID: 0} 362 | m_PrefabAsset: {fileID: 0} 363 | serializedVersion: 6 364 | m_Component: 365 | - component: {fileID: 748227659} 366 | - component: {fileID: 748227658} 367 | - component: {fileID: 748227657} 368 | m_Layer: 0 369 | m_Name: EventSystem 370 | m_TagString: Untagged 371 | m_Icon: {fileID: 0} 372 | m_NavMeshLayer: 0 373 | m_StaticEditorFlags: 0 374 | m_IsActive: 1 375 | --- !u!114 &748227657 376 | MonoBehaviour: 377 | m_ObjectHideFlags: 0 378 | m_CorrespondingSourceObject: {fileID: 0} 379 | m_PrefabInstance: {fileID: 0} 380 | m_PrefabAsset: {fileID: 0} 381 | m_GameObject: {fileID: 748227656} 382 | m_Enabled: 1 383 | m_EditorHideFlags: 0 384 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 385 | m_Name: 386 | m_EditorClassIdentifier: 387 | m_SendPointerHoverToParent: 1 388 | m_HorizontalAxis: Horizontal 389 | m_VerticalAxis: Vertical 390 | m_SubmitButton: Submit 391 | m_CancelButton: Cancel 392 | m_InputActionsPerSecond: 10 393 | m_RepeatDelay: 0.5 394 | m_ForceModuleActive: 0 395 | --- !u!114 &748227658 396 | MonoBehaviour: 397 | m_ObjectHideFlags: 0 398 | m_CorrespondingSourceObject: {fileID: 0} 399 | m_PrefabInstance: {fileID: 0} 400 | m_PrefabAsset: {fileID: 0} 401 | m_GameObject: {fileID: 748227656} 402 | m_Enabled: 1 403 | m_EditorHideFlags: 0 404 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 405 | m_Name: 406 | m_EditorClassIdentifier: 407 | m_FirstSelected: {fileID: 0} 408 | m_sendNavigationEvents: 1 409 | m_DragThreshold: 10 410 | --- !u!4 &748227659 411 | Transform: 412 | m_ObjectHideFlags: 0 413 | m_CorrespondingSourceObject: {fileID: 0} 414 | m_PrefabInstance: {fileID: 0} 415 | m_PrefabAsset: {fileID: 0} 416 | m_GameObject: {fileID: 748227656} 417 | serializedVersion: 2 418 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 419 | m_LocalPosition: {x: 0, y: 0, z: 0} 420 | m_LocalScale: {x: 1, y: 1, z: 1} 421 | m_ConstrainProportionsScale: 0 422 | m_Children: [] 423 | m_Father: {fileID: 0} 424 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 425 | --- !u!1 &1028841916 426 | GameObject: 427 | m_ObjectHideFlags: 0 428 | m_CorrespondingSourceObject: {fileID: 0} 429 | m_PrefabInstance: {fileID: 0} 430 | m_PrefabAsset: {fileID: 0} 431 | serializedVersion: 6 432 | m_Component: 433 | - component: {fileID: 1028841917} 434 | - component: {fileID: 1028841920} 435 | - component: {fileID: 1028841919} 436 | - component: {fileID: 1028841918} 437 | m_Layer: 5 438 | m_Name: PlasmaImage 439 | m_TagString: Untagged 440 | m_Icon: {fileID: 0} 441 | m_NavMeshLayer: 0 442 | m_StaticEditorFlags: 0 443 | m_IsActive: 1 444 | --- !u!224 &1028841917 445 | RectTransform: 446 | m_ObjectHideFlags: 0 447 | m_CorrespondingSourceObject: {fileID: 0} 448 | m_PrefabInstance: {fileID: 0} 449 | m_PrefabAsset: {fileID: 0} 450 | m_GameObject: {fileID: 1028841916} 451 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 452 | m_LocalPosition: {x: 0, y: 0, z: 0} 453 | m_LocalScale: {x: 1, y: 1, z: 1} 454 | m_ConstrainProportionsScale: 0 455 | m_Children: [] 456 | m_Father: {fileID: 709874131} 457 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 458 | m_AnchorMin: {x: 0.5, y: 0.5} 459 | m_AnchorMax: {x: 0.5, y: 0.5} 460 | m_AnchoredPosition: {x: 0, y: 0} 461 | m_SizeDelta: {x: 512, y: 512} 462 | m_Pivot: {x: 0.5, y: 0.5} 463 | --- !u!114 &1028841918 464 | MonoBehaviour: 465 | m_ObjectHideFlags: 0 466 | m_CorrespondingSourceObject: {fileID: 0} 467 | m_PrefabInstance: {fileID: 0} 468 | m_PrefabAsset: {fileID: 0} 469 | m_GameObject: {fileID: 1028841916} 470 | m_Enabled: 1 471 | m_EditorHideFlags: 0 472 | m_Script: {fileID: 11500000, guid: 73f02d864647f40a4b713dbca147231f, type: 3} 473 | m_Name: 474 | m_EditorClassIdentifier: 475 | rawImage: {fileID: 1028841919} 476 | width: 128 477 | height: 128 478 | _updateAsync: 1 479 | --- !u!114 &1028841919 480 | MonoBehaviour: 481 | m_ObjectHideFlags: 0 482 | m_CorrespondingSourceObject: {fileID: 0} 483 | m_PrefabInstance: {fileID: 0} 484 | m_PrefabAsset: {fileID: 0} 485 | m_GameObject: {fileID: 1028841916} 486 | m_Enabled: 1 487 | m_EditorHideFlags: 0 488 | m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} 489 | m_Name: 490 | m_EditorClassIdentifier: 491 | m_Material: {fileID: 0} 492 | m_Color: {r: 1, g: 1, b: 1, a: 1} 493 | m_RaycastTarget: 0 494 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 495 | m_Maskable: 1 496 | m_OnCullStateChanged: 497 | m_PersistentCalls: 498 | m_Calls: [] 499 | m_Texture: {fileID: 0} 500 | m_UVRect: 501 | serializedVersion: 2 502 | x: 0 503 | y: 0 504 | width: 1 505 | height: 1 506 | --- !u!222 &1028841920 507 | CanvasRenderer: 508 | m_ObjectHideFlags: 0 509 | m_CorrespondingSourceObject: {fileID: 0} 510 | m_PrefabInstance: {fileID: 0} 511 | m_PrefabAsset: {fileID: 0} 512 | m_GameObject: {fileID: 1028841916} 513 | m_CullTransparentMesh: 1 514 | --- !u!1 &1139637294 515 | GameObject: 516 | m_ObjectHideFlags: 0 517 | m_CorrespondingSourceObject: {fileID: 0} 518 | m_PrefabInstance: {fileID: 0} 519 | m_PrefabAsset: {fileID: 0} 520 | serializedVersion: 6 521 | m_Component: 522 | - component: {fileID: 1139637295} 523 | - component: {fileID: 1139637296} 524 | m_Layer: 5 525 | m_Name: Toggle 526 | m_TagString: Untagged 527 | m_Icon: {fileID: 0} 528 | m_NavMeshLayer: 0 529 | m_StaticEditorFlags: 0 530 | m_IsActive: 1 531 | --- !u!224 &1139637295 532 | RectTransform: 533 | m_ObjectHideFlags: 0 534 | m_CorrespondingSourceObject: {fileID: 0} 535 | m_PrefabInstance: {fileID: 0} 536 | m_PrefabAsset: {fileID: 0} 537 | m_GameObject: {fileID: 1139637294} 538 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 539 | m_LocalPosition: {x: 0, y: 0, z: 0} 540 | m_LocalScale: {x: 2, y: 2, z: 2} 541 | m_ConstrainProportionsScale: 0 542 | m_Children: 543 | - {fileID: 1817335795} 544 | - {fileID: 163909898} 545 | m_Father: {fileID: 709874131} 546 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 547 | m_AnchorMin: {x: 0.5, y: 1} 548 | m_AnchorMax: {x: 0.5, y: 1} 549 | m_AnchoredPosition: {x: 0, y: -20} 550 | m_SizeDelta: {x: 160, y: 20} 551 | m_Pivot: {x: 0.5, y: 0.5} 552 | --- !u!114 &1139637296 553 | MonoBehaviour: 554 | m_ObjectHideFlags: 0 555 | m_CorrespondingSourceObject: {fileID: 0} 556 | m_PrefabInstance: {fileID: 0} 557 | m_PrefabAsset: {fileID: 0} 558 | m_GameObject: {fileID: 1139637294} 559 | m_Enabled: 1 560 | m_EditorHideFlags: 0 561 | m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} 562 | m_Name: 563 | m_EditorClassIdentifier: 564 | m_Navigation: 565 | m_Mode: 3 566 | m_WrapAround: 0 567 | m_SelectOnUp: {fileID: 0} 568 | m_SelectOnDown: {fileID: 0} 569 | m_SelectOnLeft: {fileID: 0} 570 | m_SelectOnRight: {fileID: 0} 571 | m_Transition: 1 572 | m_Colors: 573 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 574 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 575 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 576 | m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 577 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 578 | m_ColorMultiplier: 1 579 | m_FadeDuration: 0.1 580 | m_SpriteState: 581 | m_HighlightedSprite: {fileID: 0} 582 | m_PressedSprite: {fileID: 0} 583 | m_SelectedSprite: {fileID: 0} 584 | m_DisabledSprite: {fileID: 0} 585 | m_AnimationTriggers: 586 | m_NormalTrigger: Normal 587 | m_HighlightedTrigger: Highlighted 588 | m_PressedTrigger: Pressed 589 | m_SelectedTrigger: Selected 590 | m_DisabledTrigger: Disabled 591 | m_Interactable: 1 592 | m_TargetGraphic: {fileID: 1817335796} 593 | toggleTransition: 1 594 | graphic: {fileID: 743713335} 595 | m_Group: {fileID: 0} 596 | onValueChanged: 597 | m_PersistentCalls: 598 | m_Calls: 599 | - m_Target: {fileID: 1028841918} 600 | m_TargetAssemblyTypeName: PlasmaTextureAsyncUpdater, Gilzoide.TextureAsyncApply.PlasmaColorJob 601 | m_MethodName: set_UpdateAsync 602 | m_Mode: 0 603 | m_Arguments: 604 | m_ObjectArgument: {fileID: 0} 605 | m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine 606 | m_IntArgument: 0 607 | m_FloatArgument: 0 608 | m_StringArgument: 609 | m_BoolArgument: 0 610 | m_CallState: 2 611 | m_IsOn: 1 612 | --- !u!1 &1736878521 613 | GameObject: 614 | m_ObjectHideFlags: 0 615 | m_CorrespondingSourceObject: {fileID: 0} 616 | m_PrefabInstance: {fileID: 0} 617 | m_PrefabAsset: {fileID: 0} 618 | serializedVersion: 6 619 | m_Component: 620 | - component: {fileID: 1736878525} 621 | - component: {fileID: 1736878524} 622 | - component: {fileID: 1736878523} 623 | - component: {fileID: 1736878522} 624 | m_Layer: 5 625 | m_Name: Canvas 626 | m_TagString: Untagged 627 | m_Icon: {fileID: 0} 628 | m_NavMeshLayer: 0 629 | m_StaticEditorFlags: 0 630 | m_IsActive: 1 631 | --- !u!114 &1736878522 632 | MonoBehaviour: 633 | m_ObjectHideFlags: 0 634 | m_CorrespondingSourceObject: {fileID: 0} 635 | m_PrefabInstance: {fileID: 0} 636 | m_PrefabAsset: {fileID: 0} 637 | m_GameObject: {fileID: 1736878521} 638 | m_Enabled: 1 639 | m_EditorHideFlags: 0 640 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 641 | m_Name: 642 | m_EditorClassIdentifier: 643 | m_IgnoreReversedGraphics: 1 644 | m_BlockingObjects: 0 645 | m_BlockingMask: 646 | serializedVersion: 2 647 | m_Bits: 4294967295 648 | --- !u!114 &1736878523 649 | MonoBehaviour: 650 | m_ObjectHideFlags: 0 651 | m_CorrespondingSourceObject: {fileID: 0} 652 | m_PrefabInstance: {fileID: 0} 653 | m_PrefabAsset: {fileID: 0} 654 | m_GameObject: {fileID: 1736878521} 655 | m_Enabled: 1 656 | m_EditorHideFlags: 0 657 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 658 | m_Name: 659 | m_EditorClassIdentifier: 660 | m_UiScaleMode: 1 661 | m_ReferencePixelsPerUnit: 100 662 | m_ScaleFactor: 1 663 | m_ReferenceResolution: {x: 800, y: 600} 664 | m_ScreenMatchMode: 0 665 | m_MatchWidthOrHeight: 0.5 666 | m_PhysicalUnit: 3 667 | m_FallbackScreenDPI: 96 668 | m_DefaultSpriteDPI: 96 669 | m_DynamicPixelsPerUnit: 1 670 | m_PresetInfoIsWorld: 0 671 | --- !u!223 &1736878524 672 | Canvas: 673 | m_ObjectHideFlags: 0 674 | m_CorrespondingSourceObject: {fileID: 0} 675 | m_PrefabInstance: {fileID: 0} 676 | m_PrefabAsset: {fileID: 0} 677 | m_GameObject: {fileID: 1736878521} 678 | m_Enabled: 1 679 | serializedVersion: 3 680 | m_RenderMode: 0 681 | m_Camera: {fileID: 0} 682 | m_PlaneDistance: 100 683 | m_PixelPerfect: 0 684 | m_ReceivesEvents: 1 685 | m_OverrideSorting: 0 686 | m_OverridePixelPerfect: 0 687 | m_SortingBucketNormalizedSize: 0 688 | m_VertexColorAlwaysGammaSpace: 0 689 | m_AdditionalShaderChannelsFlag: 25 690 | m_UpdateRectTransformForStandalone: 0 691 | m_SortingLayerID: 0 692 | m_SortingOrder: 0 693 | m_TargetDisplay: 0 694 | --- !u!224 &1736878525 695 | RectTransform: 696 | m_ObjectHideFlags: 0 697 | m_CorrespondingSourceObject: {fileID: 0} 698 | m_PrefabInstance: {fileID: 0} 699 | m_PrefabAsset: {fileID: 0} 700 | m_GameObject: {fileID: 1736878521} 701 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 702 | m_LocalPosition: {x: 0, y: 0, z: 0} 703 | m_LocalScale: {x: 0, y: 0, z: 0} 704 | m_ConstrainProportionsScale: 0 705 | m_Children: 706 | - {fileID: 709874131} 707 | m_Father: {fileID: 0} 708 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 709 | m_AnchorMin: {x: 0, y: 0} 710 | m_AnchorMax: {x: 0, y: 0} 711 | m_AnchoredPosition: {x: 0, y: 0} 712 | m_SizeDelta: {x: 0, y: 0} 713 | m_Pivot: {x: 0, y: 0} 714 | --- !u!1 &1817335794 715 | GameObject: 716 | m_ObjectHideFlags: 0 717 | m_CorrespondingSourceObject: {fileID: 0} 718 | m_PrefabInstance: {fileID: 0} 719 | m_PrefabAsset: {fileID: 0} 720 | serializedVersion: 6 721 | m_Component: 722 | - component: {fileID: 1817335795} 723 | - component: {fileID: 1817335797} 724 | - component: {fileID: 1817335796} 725 | m_Layer: 5 726 | m_Name: Background 727 | m_TagString: Untagged 728 | m_Icon: {fileID: 0} 729 | m_NavMeshLayer: 0 730 | m_StaticEditorFlags: 0 731 | m_IsActive: 1 732 | --- !u!224 &1817335795 733 | RectTransform: 734 | m_ObjectHideFlags: 0 735 | m_CorrespondingSourceObject: {fileID: 0} 736 | m_PrefabInstance: {fileID: 0} 737 | m_PrefabAsset: {fileID: 0} 738 | m_GameObject: {fileID: 1817335794} 739 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 740 | m_LocalPosition: {x: 0, y: 0, z: 0} 741 | m_LocalScale: {x: 1, y: 1, z: 1} 742 | m_ConstrainProportionsScale: 0 743 | m_Children: 744 | - {fileID: 743713334} 745 | m_Father: {fileID: 1139637295} 746 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 747 | m_AnchorMin: {x: 0, y: 1} 748 | m_AnchorMax: {x: 0, y: 1} 749 | m_AnchoredPosition: {x: 10, y: -10} 750 | m_SizeDelta: {x: 20, y: 20} 751 | m_Pivot: {x: 0.5, y: 0.5} 752 | --- !u!114 &1817335796 753 | MonoBehaviour: 754 | m_ObjectHideFlags: 0 755 | m_CorrespondingSourceObject: {fileID: 0} 756 | m_PrefabInstance: {fileID: 0} 757 | m_PrefabAsset: {fileID: 0} 758 | m_GameObject: {fileID: 1817335794} 759 | m_Enabled: 1 760 | m_EditorHideFlags: 0 761 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 762 | m_Name: 763 | m_EditorClassIdentifier: 764 | m_Material: {fileID: 0} 765 | m_Color: {r: 1, g: 1, b: 1, a: 1} 766 | m_RaycastTarget: 1 767 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 768 | m_Maskable: 1 769 | m_OnCullStateChanged: 770 | m_PersistentCalls: 771 | m_Calls: [] 772 | m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} 773 | m_Type: 1 774 | m_PreserveAspect: 0 775 | m_FillCenter: 1 776 | m_FillMethod: 4 777 | m_FillAmount: 1 778 | m_FillClockwise: 1 779 | m_FillOrigin: 0 780 | m_UseSpriteMesh: 0 781 | m_PixelsPerUnitMultiplier: 1 782 | --- !u!222 &1817335797 783 | CanvasRenderer: 784 | m_ObjectHideFlags: 0 785 | m_CorrespondingSourceObject: {fileID: 0} 786 | m_PrefabInstance: {fileID: 0} 787 | m_PrefabAsset: {fileID: 0} 788 | m_GameObject: {fileID: 1817335794} 789 | m_CullTransparentMesh: 1 790 | --- !u!1 &1940076461 791 | GameObject: 792 | m_ObjectHideFlags: 0 793 | m_CorrespondingSourceObject: {fileID: 0} 794 | m_PrefabInstance: {fileID: 0} 795 | m_PrefabAsset: {fileID: 0} 796 | serializedVersion: 6 797 | m_Component: 798 | - component: {fileID: 1940076463} 799 | - component: {fileID: 1940076462} 800 | m_Layer: 0 801 | m_Name: Directional Light 802 | m_TagString: Untagged 803 | m_Icon: {fileID: 0} 804 | m_NavMeshLayer: 0 805 | m_StaticEditorFlags: 0 806 | m_IsActive: 1 807 | --- !u!108 &1940076462 808 | Light: 809 | m_ObjectHideFlags: 0 810 | m_CorrespondingSourceObject: {fileID: 0} 811 | m_PrefabInstance: {fileID: 0} 812 | m_PrefabAsset: {fileID: 0} 813 | m_GameObject: {fileID: 1940076461} 814 | m_Enabled: 1 815 | serializedVersion: 10 816 | m_Type: 1 817 | m_Shape: 0 818 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 819 | m_Intensity: 1 820 | m_Range: 10 821 | m_SpotAngle: 30 822 | m_InnerSpotAngle: 21.80208 823 | m_CookieSize: 10 824 | m_Shadows: 825 | m_Type: 2 826 | m_Resolution: -1 827 | m_CustomResolution: -1 828 | m_Strength: 1 829 | m_Bias: 0.05 830 | m_NormalBias: 0.4 831 | m_NearPlane: 0.2 832 | m_CullingMatrixOverride: 833 | e00: 1 834 | e01: 0 835 | e02: 0 836 | e03: 0 837 | e10: 0 838 | e11: 1 839 | e12: 0 840 | e13: 0 841 | e20: 0 842 | e21: 0 843 | e22: 1 844 | e23: 0 845 | e30: 0 846 | e31: 0 847 | e32: 0 848 | e33: 1 849 | m_UseCullingMatrixOverride: 0 850 | m_Cookie: {fileID: 0} 851 | m_DrawHalo: 0 852 | m_Flare: {fileID: 0} 853 | m_RenderMode: 0 854 | m_CullingMask: 855 | serializedVersion: 2 856 | m_Bits: 4294967295 857 | m_RenderingLayerMask: 1 858 | m_Lightmapping: 4 859 | m_LightShadowCasterMode: 0 860 | m_AreaSize: {x: 1, y: 1} 861 | m_BounceIntensity: 1 862 | m_ColorTemperature: 6570 863 | m_UseColorTemperature: 0 864 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 865 | m_UseBoundingSphereOverride: 0 866 | m_UseViewFrustumForShadowCasterCull: 1 867 | m_ShadowRadius: 0 868 | m_ShadowAngle: 0 869 | --- !u!4 &1940076463 870 | Transform: 871 | m_ObjectHideFlags: 0 872 | m_CorrespondingSourceObject: {fileID: 0} 873 | m_PrefabInstance: {fileID: 0} 874 | m_PrefabAsset: {fileID: 0} 875 | m_GameObject: {fileID: 1940076461} 876 | serializedVersion: 2 877 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 878 | m_LocalPosition: {x: 0, y: 3, z: 0} 879 | m_LocalScale: {x: 1, y: 1, z: 1} 880 | m_ConstrainProportionsScale: 0 881 | m_Children: [] 882 | m_Father: {fileID: 0} 883 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 884 | --- !u!1 &2088462109 885 | GameObject: 886 | m_ObjectHideFlags: 0 887 | m_CorrespondingSourceObject: {fileID: 0} 888 | m_PrefabInstance: {fileID: 0} 889 | m_PrefabAsset: {fileID: 0} 890 | serializedVersion: 6 891 | m_Component: 892 | - component: {fileID: 2088462112} 893 | - component: {fileID: 2088462111} 894 | - component: {fileID: 2088462110} 895 | m_Layer: 0 896 | m_Name: Main Camera 897 | m_TagString: MainCamera 898 | m_Icon: {fileID: 0} 899 | m_NavMeshLayer: 0 900 | m_StaticEditorFlags: 0 901 | m_IsActive: 1 902 | --- !u!81 &2088462110 903 | AudioListener: 904 | m_ObjectHideFlags: 0 905 | m_CorrespondingSourceObject: {fileID: 0} 906 | m_PrefabInstance: {fileID: 0} 907 | m_PrefabAsset: {fileID: 0} 908 | m_GameObject: {fileID: 2088462109} 909 | m_Enabled: 1 910 | --- !u!20 &2088462111 911 | Camera: 912 | m_ObjectHideFlags: 0 913 | m_CorrespondingSourceObject: {fileID: 0} 914 | m_PrefabInstance: {fileID: 0} 915 | m_PrefabAsset: {fileID: 0} 916 | m_GameObject: {fileID: 2088462109} 917 | m_Enabled: 1 918 | serializedVersion: 2 919 | m_ClearFlags: 1 920 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 921 | m_projectionMatrixMode: 1 922 | m_GateFitMode: 2 923 | m_FOVAxisMode: 0 924 | m_Iso: 200 925 | m_ShutterSpeed: 0.005 926 | m_Aperture: 16 927 | m_FocusDistance: 10 928 | m_FocalLength: 50 929 | m_BladeCount: 5 930 | m_Curvature: {x: 2, y: 11} 931 | m_BarrelClipping: 0.25 932 | m_Anamorphism: 0 933 | m_SensorSize: {x: 36, y: 24} 934 | m_LensShift: {x: 0, y: 0} 935 | m_NormalizedViewPortRect: 936 | serializedVersion: 2 937 | x: 0 938 | y: 0 939 | width: 1 940 | height: 1 941 | near clip plane: 0.3 942 | far clip plane: 1000 943 | field of view: 60 944 | orthographic: 0 945 | orthographic size: 5 946 | m_Depth: -1 947 | m_CullingMask: 948 | serializedVersion: 2 949 | m_Bits: 4294967295 950 | m_RenderingPath: -1 951 | m_TargetTexture: {fileID: 0} 952 | m_TargetDisplay: 0 953 | m_TargetEye: 3 954 | m_HDR: 1 955 | m_AllowMSAA: 1 956 | m_AllowDynamicResolution: 0 957 | m_ForceIntoRT: 0 958 | m_OcclusionCulling: 1 959 | m_StereoConvergence: 10 960 | m_StereoSeparation: 0.022 961 | --- !u!4 &2088462112 962 | Transform: 963 | m_ObjectHideFlags: 0 964 | m_CorrespondingSourceObject: {fileID: 0} 965 | m_PrefabInstance: {fileID: 0} 966 | m_PrefabAsset: {fileID: 0} 967 | m_GameObject: {fileID: 2088462109} 968 | serializedVersion: 2 969 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 970 | m_LocalPosition: {x: 0, y: 1, z: -10} 971 | m_LocalScale: {x: 1, y: 1, z: 1} 972 | m_ConstrainProportionsScale: 0 973 | m_Children: [] 974 | m_Father: {fileID: 0} 975 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 976 | --- !u!1660057539 &9223372036854775807 977 | SceneRoots: 978 | m_ObjectHideFlags: 0 979 | m_Roots: 980 | - {fileID: 2088462112} 981 | - {fileID: 1940076463} 982 | - {fileID: 1736878525} 983 | - {fileID: 748227659} 984 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/PlasmaColorJob.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fef6fb5b334e466dbfa6690de075fc5 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/PlasmaTextureAsyncUpdater.cs: -------------------------------------------------------------------------------- 1 | using Gilzoide.TextureApplyAsync; 2 | using Unity.Collections; 3 | using Unity.Jobs; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | public class PlasmaTextureAsyncUpdater : MonoBehaviour 8 | { 9 | [SerializeField] private RawImage rawImage; 10 | [SerializeField, Min(1)] private int width = 128; 11 | [SerializeField, Min(1)] private int height = 128; 12 | [SerializeField] bool _updateAsync = true; 13 | 14 | public bool UpdateAsync 15 | { 16 | get => _updateAsync; 17 | set => _updateAsync = value; 18 | } 19 | 20 | private Texture2D _texture; 21 | private TextureApplyAsyncHandle _textureApplyAsyncHandle; 22 | private JobHandle _jobHandle; 23 | 24 | void OnEnable() 25 | { 26 | if (_texture == null) 27 | { 28 | _texture = new Texture2D(width, height, TextureFormat.RGBA32, false, false) 29 | { 30 | name = name 31 | }; 32 | rawImage.texture = _texture; 33 | } 34 | else 35 | { 36 | _texture.Reinitialize(width, height, TextureFormat.RGBA32, false); 37 | _texture.Apply(); 38 | } 39 | _textureApplyAsyncHandle = new TextureApplyAsyncHandle(_texture); 40 | } 41 | 42 | void OnDisable() 43 | { 44 | _textureApplyAsyncHandle.Dispose(); 45 | } 46 | 47 | void OnDestroy() 48 | { 49 | Destroy(_texture); 50 | } 51 | 52 | #if UNITY_EDITOR 53 | void OnValidate() 54 | { 55 | if (isActiveAndEnabled && _texture) 56 | { 57 | _texture.Reinitialize(width, height, TextureFormat.RGBA32, false); 58 | _texture.Apply(); 59 | _textureApplyAsyncHandle.Reinitialize(); 60 | } 61 | } 62 | #endif 63 | 64 | void Update() 65 | { 66 | NativeArray pixels = _texture.GetPixelData(0); 67 | _jobHandle = new PlasmaColorJob 68 | { 69 | Time = Time.time, 70 | Width = _texture.width, 71 | Height = _texture.height, 72 | Pixels = pixels, 73 | }.Schedule(pixels.Length, 64); 74 | } 75 | 76 | void LateUpdate() 77 | { 78 | _jobHandle.Complete(); 79 | if (UpdateAsync) 80 | { 81 | _textureApplyAsyncHandle.ScheduleUpdateOnce(); 82 | } 83 | else 84 | { 85 | _texture.Apply(); 86 | } 87 | } 88 | 89 | #if HAVE_BURST 90 | [Unity.Burst.BurstCompile] 91 | #endif 92 | private struct PlasmaColorJob : IJobParallelFor 93 | { 94 | public float Time; 95 | public int Height; 96 | public int Width; 97 | [WriteOnly] public NativeArray Pixels; 98 | 99 | // Old school plasma effect 100 | // Reference code: https://github.com/keijiro/TextureUpdateExample/blob/master/Plugin/Plasma.c 101 | static Color32 Plasma(int x, int y, int width, int height, float time) 102 | { 103 | float px = (float) x / width; 104 | float py = (float) y / height; 105 | 106 | float l = Mathf.Sin(px * Mathf.Sin(time * 1.3f) + Mathf.Sin(py * 4 + time) * Mathf.Sin(time)); 107 | 108 | byte r = (byte) (Mathf.Sin(l * 6) * 127 + 127); 109 | byte g = (byte) (Mathf.Sin(l * 7) * 127 + 127); 110 | byte b = (byte) (Mathf.Sin(l * 10) * 127 + 127); 111 | 112 | return new Color32(r, g, b, 255); 113 | } 114 | 115 | public void Execute(int i) 116 | { 117 | Pixels[i] = Plasma(i % Width, i / Width, Width, Height, Time); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Samples~/PlasmaColorJob/PlasmaTextureAsyncUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73f02d864647f40a4b713dbca147231f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 10 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Samples~/RandomColors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ba9ab46cdb9d42d2b05b443f501e6ff 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Samples~/RandomColors/Gilzoide.TextureAsyncApply.RandomColors.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Gilzoide.TextureAsyncApply.RandomColors", 3 | "rootNamespace": "", 4 | "references": [ 5 | "Gilzoide.TextureApplyAsync" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Samples~/RandomColors/Gilzoide.TextureAsyncApply.RandomColors.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81d7d1133e0194f1796eed176b4e6b6c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples~/RandomColors/RandomColors.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 3 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | buildHeightMesh: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &709874130 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 709874131} 135 | - component: {fileID: 709874133} 136 | - component: {fileID: 709874132} 137 | m_Layer: 5 138 | m_Name: Panel 139 | m_TagString: Untagged 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!224 &709874131 145 | RectTransform: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 709874130} 151 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 152 | m_LocalPosition: {x: 0, y: 0, z: 0} 153 | m_LocalScale: {x: 1, y: 1, z: 1} 154 | m_ConstrainProportionsScale: 0 155 | m_Children: 156 | - {fileID: 1028841917} 157 | m_Father: {fileID: 1736878525} 158 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 159 | m_AnchorMin: {x: 0, y: 0} 160 | m_AnchorMax: {x: 1, y: 1} 161 | m_AnchoredPosition: {x: 0, y: 0} 162 | m_SizeDelta: {x: 0, y: 0} 163 | m_Pivot: {x: 0.5, y: 0.5} 164 | --- !u!114 &709874132 165 | MonoBehaviour: 166 | m_ObjectHideFlags: 0 167 | m_CorrespondingSourceObject: {fileID: 0} 168 | m_PrefabInstance: {fileID: 0} 169 | m_PrefabAsset: {fileID: 0} 170 | m_GameObject: {fileID: 709874130} 171 | m_Enabled: 1 172 | m_EditorHideFlags: 0 173 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 174 | m_Name: 175 | m_EditorClassIdentifier: 176 | m_Material: {fileID: 0} 177 | m_Color: {r: 1, g: 1, b: 1, a: 0.392} 178 | m_RaycastTarget: 1 179 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 180 | m_Maskable: 1 181 | m_OnCullStateChanged: 182 | m_PersistentCalls: 183 | m_Calls: [] 184 | m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} 185 | m_Type: 1 186 | m_PreserveAspect: 0 187 | m_FillCenter: 1 188 | m_FillMethod: 4 189 | m_FillAmount: 1 190 | m_FillClockwise: 1 191 | m_FillOrigin: 0 192 | m_UseSpriteMesh: 0 193 | m_PixelsPerUnitMultiplier: 1 194 | --- !u!222 &709874133 195 | CanvasRenderer: 196 | m_ObjectHideFlags: 0 197 | m_CorrespondingSourceObject: {fileID: 0} 198 | m_PrefabInstance: {fileID: 0} 199 | m_PrefabAsset: {fileID: 0} 200 | m_GameObject: {fileID: 709874130} 201 | m_CullTransparentMesh: 1 202 | --- !u!1 &748227656 203 | GameObject: 204 | m_ObjectHideFlags: 0 205 | m_CorrespondingSourceObject: {fileID: 0} 206 | m_PrefabInstance: {fileID: 0} 207 | m_PrefabAsset: {fileID: 0} 208 | serializedVersion: 6 209 | m_Component: 210 | - component: {fileID: 748227659} 211 | - component: {fileID: 748227658} 212 | - component: {fileID: 748227657} 213 | m_Layer: 0 214 | m_Name: EventSystem 215 | m_TagString: Untagged 216 | m_Icon: {fileID: 0} 217 | m_NavMeshLayer: 0 218 | m_StaticEditorFlags: 0 219 | m_IsActive: 1 220 | --- !u!114 &748227657 221 | MonoBehaviour: 222 | m_ObjectHideFlags: 0 223 | m_CorrespondingSourceObject: {fileID: 0} 224 | m_PrefabInstance: {fileID: 0} 225 | m_PrefabAsset: {fileID: 0} 226 | m_GameObject: {fileID: 748227656} 227 | m_Enabled: 1 228 | m_EditorHideFlags: 0 229 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 230 | m_Name: 231 | m_EditorClassIdentifier: 232 | m_SendPointerHoverToParent: 1 233 | m_HorizontalAxis: Horizontal 234 | m_VerticalAxis: Vertical 235 | m_SubmitButton: Submit 236 | m_CancelButton: Cancel 237 | m_InputActionsPerSecond: 10 238 | m_RepeatDelay: 0.5 239 | m_ForceModuleActive: 0 240 | --- !u!114 &748227658 241 | MonoBehaviour: 242 | m_ObjectHideFlags: 0 243 | m_CorrespondingSourceObject: {fileID: 0} 244 | m_PrefabInstance: {fileID: 0} 245 | m_PrefabAsset: {fileID: 0} 246 | m_GameObject: {fileID: 748227656} 247 | m_Enabled: 1 248 | m_EditorHideFlags: 0 249 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 250 | m_Name: 251 | m_EditorClassIdentifier: 252 | m_FirstSelected: {fileID: 0} 253 | m_sendNavigationEvents: 1 254 | m_DragThreshold: 10 255 | --- !u!4 &748227659 256 | Transform: 257 | m_ObjectHideFlags: 0 258 | m_CorrespondingSourceObject: {fileID: 0} 259 | m_PrefabInstance: {fileID: 0} 260 | m_PrefabAsset: {fileID: 0} 261 | m_GameObject: {fileID: 748227656} 262 | serializedVersion: 2 263 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 264 | m_LocalPosition: {x: 0, y: 0, z: 0} 265 | m_LocalScale: {x: 1, y: 1, z: 1} 266 | m_ConstrainProportionsScale: 0 267 | m_Children: [] 268 | m_Father: {fileID: 0} 269 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 270 | --- !u!1 &1028841916 271 | GameObject: 272 | m_ObjectHideFlags: 0 273 | m_CorrespondingSourceObject: {fileID: 0} 274 | m_PrefabInstance: {fileID: 0} 275 | m_PrefabAsset: {fileID: 0} 276 | serializedVersion: 6 277 | m_Component: 278 | - component: {fileID: 1028841917} 279 | - component: {fileID: 1028841920} 280 | - component: {fileID: 1028841919} 281 | - component: {fileID: 1028841918} 282 | m_Layer: 5 283 | m_Name: RandomImage 284 | m_TagString: Untagged 285 | m_Icon: {fileID: 0} 286 | m_NavMeshLayer: 0 287 | m_StaticEditorFlags: 0 288 | m_IsActive: 1 289 | --- !u!224 &1028841917 290 | RectTransform: 291 | m_ObjectHideFlags: 0 292 | m_CorrespondingSourceObject: {fileID: 0} 293 | m_PrefabInstance: {fileID: 0} 294 | m_PrefabAsset: {fileID: 0} 295 | m_GameObject: {fileID: 1028841916} 296 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 297 | m_LocalPosition: {x: 0, y: 0, z: 0} 298 | m_LocalScale: {x: 1, y: 1, z: 1} 299 | m_ConstrainProportionsScale: 0 300 | m_Children: [] 301 | m_Father: {fileID: 709874131} 302 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 303 | m_AnchorMin: {x: 0.5, y: 0.5} 304 | m_AnchorMax: {x: 0.5, y: 0.5} 305 | m_AnchoredPosition: {x: 0, y: 0} 306 | m_SizeDelta: {x: 512, y: 512} 307 | m_Pivot: {x: 0.5, y: 0.5} 308 | --- !u!114 &1028841918 309 | MonoBehaviour: 310 | m_ObjectHideFlags: 0 311 | m_CorrespondingSourceObject: {fileID: 0} 312 | m_PrefabInstance: {fileID: 0} 313 | m_PrefabAsset: {fileID: 0} 314 | m_GameObject: {fileID: 1028841916} 315 | m_Enabled: 1 316 | m_EditorHideFlags: 0 317 | m_Script: {fileID: 11500000, guid: 0c4aa072013484f42bb0098d824e0be2, type: 3} 318 | m_Name: 319 | m_EditorClassIdentifier: 320 | rawImage: {fileID: 1028841919} 321 | --- !u!114 &1028841919 322 | MonoBehaviour: 323 | m_ObjectHideFlags: 0 324 | m_CorrespondingSourceObject: {fileID: 0} 325 | m_PrefabInstance: {fileID: 0} 326 | m_PrefabAsset: {fileID: 0} 327 | m_GameObject: {fileID: 1028841916} 328 | m_Enabled: 1 329 | m_EditorHideFlags: 0 330 | m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} 331 | m_Name: 332 | m_EditorClassIdentifier: 333 | m_Material: {fileID: 0} 334 | m_Color: {r: 1, g: 1, b: 1, a: 1} 335 | m_RaycastTarget: 0 336 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 337 | m_Maskable: 1 338 | m_OnCullStateChanged: 339 | m_PersistentCalls: 340 | m_Calls: [] 341 | m_Texture: {fileID: 0} 342 | m_UVRect: 343 | serializedVersion: 2 344 | x: 0 345 | y: 0 346 | width: 1 347 | height: 1 348 | --- !u!222 &1028841920 349 | CanvasRenderer: 350 | m_ObjectHideFlags: 0 351 | m_CorrespondingSourceObject: {fileID: 0} 352 | m_PrefabInstance: {fileID: 0} 353 | m_PrefabAsset: {fileID: 0} 354 | m_GameObject: {fileID: 1028841916} 355 | m_CullTransparentMesh: 1 356 | --- !u!1 &1736878521 357 | GameObject: 358 | m_ObjectHideFlags: 0 359 | m_CorrespondingSourceObject: {fileID: 0} 360 | m_PrefabInstance: {fileID: 0} 361 | m_PrefabAsset: {fileID: 0} 362 | serializedVersion: 6 363 | m_Component: 364 | - component: {fileID: 1736878525} 365 | - component: {fileID: 1736878524} 366 | - component: {fileID: 1736878523} 367 | - component: {fileID: 1736878522} 368 | m_Layer: 5 369 | m_Name: Canvas 370 | m_TagString: Untagged 371 | m_Icon: {fileID: 0} 372 | m_NavMeshLayer: 0 373 | m_StaticEditorFlags: 0 374 | m_IsActive: 1 375 | --- !u!114 &1736878522 376 | MonoBehaviour: 377 | m_ObjectHideFlags: 0 378 | m_CorrespondingSourceObject: {fileID: 0} 379 | m_PrefabInstance: {fileID: 0} 380 | m_PrefabAsset: {fileID: 0} 381 | m_GameObject: {fileID: 1736878521} 382 | m_Enabled: 1 383 | m_EditorHideFlags: 0 384 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 385 | m_Name: 386 | m_EditorClassIdentifier: 387 | m_IgnoreReversedGraphics: 1 388 | m_BlockingObjects: 0 389 | m_BlockingMask: 390 | serializedVersion: 2 391 | m_Bits: 4294967295 392 | --- !u!114 &1736878523 393 | MonoBehaviour: 394 | m_ObjectHideFlags: 0 395 | m_CorrespondingSourceObject: {fileID: 0} 396 | m_PrefabInstance: {fileID: 0} 397 | m_PrefabAsset: {fileID: 0} 398 | m_GameObject: {fileID: 1736878521} 399 | m_Enabled: 1 400 | m_EditorHideFlags: 0 401 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 402 | m_Name: 403 | m_EditorClassIdentifier: 404 | m_UiScaleMode: 1 405 | m_ReferencePixelsPerUnit: 100 406 | m_ScaleFactor: 1 407 | m_ReferenceResolution: {x: 800, y: 600} 408 | m_ScreenMatchMode: 0 409 | m_MatchWidthOrHeight: 0.5 410 | m_PhysicalUnit: 3 411 | m_FallbackScreenDPI: 96 412 | m_DefaultSpriteDPI: 96 413 | m_DynamicPixelsPerUnit: 1 414 | m_PresetInfoIsWorld: 0 415 | --- !u!223 &1736878524 416 | Canvas: 417 | m_ObjectHideFlags: 0 418 | m_CorrespondingSourceObject: {fileID: 0} 419 | m_PrefabInstance: {fileID: 0} 420 | m_PrefabAsset: {fileID: 0} 421 | m_GameObject: {fileID: 1736878521} 422 | m_Enabled: 1 423 | serializedVersion: 3 424 | m_RenderMode: 0 425 | m_Camera: {fileID: 0} 426 | m_PlaneDistance: 100 427 | m_PixelPerfect: 0 428 | m_ReceivesEvents: 1 429 | m_OverrideSorting: 0 430 | m_OverridePixelPerfect: 0 431 | m_SortingBucketNormalizedSize: 0 432 | m_VertexColorAlwaysGammaSpace: 0 433 | m_AdditionalShaderChannelsFlag: 25 434 | m_UpdateRectTransformForStandalone: 0 435 | m_SortingLayerID: 0 436 | m_SortingOrder: 0 437 | m_TargetDisplay: 0 438 | --- !u!224 &1736878525 439 | RectTransform: 440 | m_ObjectHideFlags: 0 441 | m_CorrespondingSourceObject: {fileID: 0} 442 | m_PrefabInstance: {fileID: 0} 443 | m_PrefabAsset: {fileID: 0} 444 | m_GameObject: {fileID: 1736878521} 445 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 446 | m_LocalPosition: {x: 0, y: 0, z: 0} 447 | m_LocalScale: {x: 0, y: 0, z: 0} 448 | m_ConstrainProportionsScale: 0 449 | m_Children: 450 | - {fileID: 709874131} 451 | m_Father: {fileID: 0} 452 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 453 | m_AnchorMin: {x: 0, y: 0} 454 | m_AnchorMax: {x: 0, y: 0} 455 | m_AnchoredPosition: {x: 0, y: 0} 456 | m_SizeDelta: {x: 0, y: 0} 457 | m_Pivot: {x: 0, y: 0} 458 | --- !u!1 &1940076461 459 | GameObject: 460 | m_ObjectHideFlags: 0 461 | m_CorrespondingSourceObject: {fileID: 0} 462 | m_PrefabInstance: {fileID: 0} 463 | m_PrefabAsset: {fileID: 0} 464 | serializedVersion: 6 465 | m_Component: 466 | - component: {fileID: 1940076463} 467 | - component: {fileID: 1940076462} 468 | m_Layer: 0 469 | m_Name: Directional Light 470 | m_TagString: Untagged 471 | m_Icon: {fileID: 0} 472 | m_NavMeshLayer: 0 473 | m_StaticEditorFlags: 0 474 | m_IsActive: 1 475 | --- !u!108 &1940076462 476 | Light: 477 | m_ObjectHideFlags: 0 478 | m_CorrespondingSourceObject: {fileID: 0} 479 | m_PrefabInstance: {fileID: 0} 480 | m_PrefabAsset: {fileID: 0} 481 | m_GameObject: {fileID: 1940076461} 482 | m_Enabled: 1 483 | serializedVersion: 10 484 | m_Type: 1 485 | m_Shape: 0 486 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 487 | m_Intensity: 1 488 | m_Range: 10 489 | m_SpotAngle: 30 490 | m_InnerSpotAngle: 21.80208 491 | m_CookieSize: 10 492 | m_Shadows: 493 | m_Type: 2 494 | m_Resolution: -1 495 | m_CustomResolution: -1 496 | m_Strength: 1 497 | m_Bias: 0.05 498 | m_NormalBias: 0.4 499 | m_NearPlane: 0.2 500 | m_CullingMatrixOverride: 501 | e00: 1 502 | e01: 0 503 | e02: 0 504 | e03: 0 505 | e10: 0 506 | e11: 1 507 | e12: 0 508 | e13: 0 509 | e20: 0 510 | e21: 0 511 | e22: 1 512 | e23: 0 513 | e30: 0 514 | e31: 0 515 | e32: 0 516 | e33: 1 517 | m_UseCullingMatrixOverride: 0 518 | m_Cookie: {fileID: 0} 519 | m_DrawHalo: 0 520 | m_Flare: {fileID: 0} 521 | m_RenderMode: 0 522 | m_CullingMask: 523 | serializedVersion: 2 524 | m_Bits: 4294967295 525 | m_RenderingLayerMask: 1 526 | m_Lightmapping: 4 527 | m_LightShadowCasterMode: 0 528 | m_AreaSize: {x: 1, y: 1} 529 | m_BounceIntensity: 1 530 | m_ColorTemperature: 6570 531 | m_UseColorTemperature: 0 532 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 533 | m_UseBoundingSphereOverride: 0 534 | m_UseViewFrustumForShadowCasterCull: 1 535 | m_ShadowRadius: 0 536 | m_ShadowAngle: 0 537 | --- !u!4 &1940076463 538 | Transform: 539 | m_ObjectHideFlags: 0 540 | m_CorrespondingSourceObject: {fileID: 0} 541 | m_PrefabInstance: {fileID: 0} 542 | m_PrefabAsset: {fileID: 0} 543 | m_GameObject: {fileID: 1940076461} 544 | serializedVersion: 2 545 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 546 | m_LocalPosition: {x: 0, y: 3, z: 0} 547 | m_LocalScale: {x: 1, y: 1, z: 1} 548 | m_ConstrainProportionsScale: 0 549 | m_Children: [] 550 | m_Father: {fileID: 0} 551 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 552 | --- !u!1 &2088462109 553 | GameObject: 554 | m_ObjectHideFlags: 0 555 | m_CorrespondingSourceObject: {fileID: 0} 556 | m_PrefabInstance: {fileID: 0} 557 | m_PrefabAsset: {fileID: 0} 558 | serializedVersion: 6 559 | m_Component: 560 | - component: {fileID: 2088462112} 561 | - component: {fileID: 2088462111} 562 | - component: {fileID: 2088462110} 563 | m_Layer: 0 564 | m_Name: Main Camera 565 | m_TagString: MainCamera 566 | m_Icon: {fileID: 0} 567 | m_NavMeshLayer: 0 568 | m_StaticEditorFlags: 0 569 | m_IsActive: 1 570 | --- !u!81 &2088462110 571 | AudioListener: 572 | m_ObjectHideFlags: 0 573 | m_CorrespondingSourceObject: {fileID: 0} 574 | m_PrefabInstance: {fileID: 0} 575 | m_PrefabAsset: {fileID: 0} 576 | m_GameObject: {fileID: 2088462109} 577 | m_Enabled: 1 578 | --- !u!20 &2088462111 579 | Camera: 580 | m_ObjectHideFlags: 0 581 | m_CorrespondingSourceObject: {fileID: 0} 582 | m_PrefabInstance: {fileID: 0} 583 | m_PrefabAsset: {fileID: 0} 584 | m_GameObject: {fileID: 2088462109} 585 | m_Enabled: 1 586 | serializedVersion: 2 587 | m_ClearFlags: 1 588 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 589 | m_projectionMatrixMode: 1 590 | m_GateFitMode: 2 591 | m_FOVAxisMode: 0 592 | m_Iso: 200 593 | m_ShutterSpeed: 0.005 594 | m_Aperture: 16 595 | m_FocusDistance: 10 596 | m_FocalLength: 50 597 | m_BladeCount: 5 598 | m_Curvature: {x: 2, y: 11} 599 | m_BarrelClipping: 0.25 600 | m_Anamorphism: 0 601 | m_SensorSize: {x: 36, y: 24} 602 | m_LensShift: {x: 0, y: 0} 603 | m_NormalizedViewPortRect: 604 | serializedVersion: 2 605 | x: 0 606 | y: 0 607 | width: 1 608 | height: 1 609 | near clip plane: 0.3 610 | far clip plane: 1000 611 | field of view: 60 612 | orthographic: 0 613 | orthographic size: 5 614 | m_Depth: -1 615 | m_CullingMask: 616 | serializedVersion: 2 617 | m_Bits: 4294967295 618 | m_RenderingPath: -1 619 | m_TargetTexture: {fileID: 0} 620 | m_TargetDisplay: 0 621 | m_TargetEye: 3 622 | m_HDR: 1 623 | m_AllowMSAA: 1 624 | m_AllowDynamicResolution: 0 625 | m_ForceIntoRT: 0 626 | m_OcclusionCulling: 1 627 | m_StereoConvergence: 10 628 | m_StereoSeparation: 0.022 629 | --- !u!4 &2088462112 630 | Transform: 631 | m_ObjectHideFlags: 0 632 | m_CorrespondingSourceObject: {fileID: 0} 633 | m_PrefabInstance: {fileID: 0} 634 | m_PrefabAsset: {fileID: 0} 635 | m_GameObject: {fileID: 2088462109} 636 | serializedVersion: 2 637 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 638 | m_LocalPosition: {x: 0, y: 1, z: -10} 639 | m_LocalScale: {x: 1, y: 1, z: 1} 640 | m_ConstrainProportionsScale: 0 641 | m_Children: [] 642 | m_Father: {fileID: 0} 643 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 644 | --- !u!1660057539 &9223372036854775807 645 | SceneRoots: 646 | m_ObjectHideFlags: 0 647 | m_Roots: 648 | - {fileID: 2088462112} 649 | - {fileID: 1940076463} 650 | - {fileID: 1736878525} 651 | - {fileID: 748227659} 652 | -------------------------------------------------------------------------------- /Samples~/RandomColors/RandomColors.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ed3d2332df2d4afeba3d2ab1bd834dc 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Samples~/RandomColors/RandomTextureAsyncUpdater.cs: -------------------------------------------------------------------------------- 1 | using Gilzoide.TextureApplyAsync; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | public class RandomTextureAsyncUpdater : MonoBehaviour 6 | { 7 | [SerializeField] private RawImage rawImage; 8 | 9 | private Texture2D _texture; 10 | private TextureApplyAsyncHandle _textureApplyAsyncHandle; 11 | 12 | void Start() 13 | { 14 | _texture = new Texture2D(64, 64, TextureFormat.RGBA32, false, false); 15 | rawImage.texture = _texture; 16 | 17 | // 1. Create a `TextureApplyAsyncHandle` for your `Texture` 18 | _textureApplyAsyncHandle = new TextureApplyAsyncHandle(_texture); 19 | 20 | // 2. If you want to update your texture every frame, 21 | // schedule the apply handle to update every frame. 22 | _textureApplyAsyncHandle.ScheduleUpdateEveryFrame(); 23 | } 24 | 25 | void Update() 26 | { 27 | // 3. Update the texture data normally 28 | for (int x = 0; x < _texture.width; x++) 29 | { 30 | for (int y = 0; y < _texture.height; y++) 31 | { 32 | _texture.SetPixel(x, y, Random.ColorHSV()); 33 | } 34 | } 35 | 36 | // 4. If you want to update your texture only once, 37 | // schedule a one-shot update. 38 | _textureApplyAsyncHandle.ScheduleUpdateOnce(); 39 | } 40 | 41 | void OnDestroy() 42 | { 43 | // 5. Dispose of the `TextureApplyAsyncHandle` when not needed anymore 44 | _textureApplyAsyncHandle.Dispose(); 45 | Destroy(_texture); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Samples~/RandomColors/RandomTextureAsyncUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c4aa072013484f42bb0098d824e0be2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 10 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /UNLICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0af2bbad0afa2455ea5afc31af6b907d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.gilzoide.texture-apply-async", 3 | "displayName": "Texture Apply Async", 4 | "version": "1.2.0", 5 | "description": "This package provides an alternative to Texture2D.Apply() that doesn't require synchronizing with the render thread, avoiding stalls in the main thread.\n\nTexture updates run in the render thread using CommandBuffers. Texture updates run before the first command of the first Camera by default, but you can use your own CommandBuffers if necessary.", 6 | "homepage": "https://github.com/gilzoide/unity-texture-apply-async", 7 | "license": "Unlicense", 8 | "author": { 9 | "name": "Gil Barbosa Reis" 10 | }, 11 | "unity": "2021.2", 12 | "samples": [ 13 | { 14 | "displayName": "Random colors", 15 | "description": "Demonstrates how to update a Texture2D every frame asynchronously using a TextureAsyncApplyHandle.", 16 | "path": "Samples~/RandomColors" 17 | }, 18 | { 19 | "displayName": "Plasma effect updated using jobs", 20 | "description": "Demonstrates how to update a Texture2D every frame asynchronously using the C# Job System in tandem with TextureAsyncApplyHandle.", 21 | "path": "Samples~/PlasmaColorJob" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 775ea3d3caa6e44eea4613859bc92dc5 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------