├── .gitattributes ├── .gitignore ├── Assets ├── Android.meta ├── Android │ ├── libPlasma.so │ └── libPlasma.so.meta ├── Cube.mat ├── Cube.mat.meta ├── Linux.meta ├── Linux │ ├── libPlasma.so │ └── libPlasma.so.meta ├── MacOS.meta ├── MacOS │ ├── Plasma.bundle │ └── Plasma.bundle.meta ├── Test.cs ├── Test.cs.meta ├── Test.unity ├── Test.unity.meta ├── Windows.meta ├── Windows │ ├── Plasma.dll │ └── Plasma.dll.meta ├── iOS.meta └── iOS │ ├── libPlasma.a │ └── libPlasma.a.meta ├── Packages ├── manifest.json └── packages-lock.json ├── Plugin ├── Android │ └── build.sh ├── Linux │ └── build.sh ├── MacOS │ └── build.sh ├── Plasma.c ├── Unity │ ├── IUnityGraphics.h │ ├── IUnityInterface.h │ └── IUnityRenderingExtensions.h ├── Windows │ ├── README.txt │ └── build.sh └── iOS │ └── build.sh ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── TimelineSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── VersionControlSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | 3 | *.cs text eol=lf diff=csharp 4 | *.shader text eol=lf 5 | *.cginc text eol=lf 6 | *.hlsl text eol=lf 7 | *.compute text eol=lf 8 | 9 | *.meta text eol=lf 10 | 11 | *.h text eol=lf 12 | *.cpp text eol=lf 13 | *.cc text eol=lf 14 | *.c text eol=lf 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | Desktop.ini 3 | .DS_Store 4 | 5 | /Library 6 | /Logs 7 | /Recordings 8 | /UserSettings 9 | /Temp 10 | 11 | /Plugin/Android/*.so 12 | /Plugin/iOS/*.a 13 | /Plugin/iOS/*.o 14 | /Plugin/Linux/*.so 15 | /Plugin/MacOS/*.so 16 | /Plugin/MacOS/*.bundle 17 | /Plugin/Windows/*.dll 18 | -------------------------------------------------------------------------------- /Assets/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ce5ef99a48059bd6a46104a0602da6b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Android/libPlasma.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/TextureUpdateExample/08f1b1441957b8490e5cc1104ad6f0054d852659/Assets/Android/libPlasma.so -------------------------------------------------------------------------------- /Assets/Android/libPlasma.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d40bb397a7e90ed0e87c7d9eec71c2bb 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 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 Win: 1 24 | Exclude Win64: 1 25 | - first: 26 | Android: Android 27 | second: 28 | enabled: 1 29 | settings: 30 | CPU: ARM64 31 | - first: 32 | Any: 33 | second: 34 | enabled: 0 35 | settings: {} 36 | - first: 37 | Editor: Editor 38 | second: 39 | enabled: 0 40 | settings: 41 | CPU: AnyCPU 42 | DefaultValueInitialized: true 43 | OS: AnyOS 44 | - first: 45 | Standalone: Linux64 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: OSXUniversal 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | - first: 63 | Standalone: Win64 64 | second: 65 | enabled: 0 66 | settings: 67 | CPU: None 68 | userData: 69 | assetBundleName: 70 | assetBundleVariant: 71 | -------------------------------------------------------------------------------- /Assets/Cube.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Cube 10 | m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _MainTex: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | m_Floats: [] 26 | m_Colors: [] 27 | -------------------------------------------------------------------------------- /Assets/Cube.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07ce45cfafb36b94e95ee6f146e1bab8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4031b286f3ad46369e0deef6732c6f4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Linux/libPlasma.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/TextureUpdateExample/08f1b1441957b8490e5cc1104ad6f0054d852659/Assets/Linux/libPlasma.so -------------------------------------------------------------------------------- /Assets/Linux/libPlasma.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e81445441e80d5f12ae20598dabd907a 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 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 Linux: 1 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 1 25 | Exclude Win: 0 26 | Exclude Win64: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: x86_64 44 | DefaultValueInitialized: true 45 | OS: Linux 46 | - first: 47 | Facebook: Win 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Facebook: Win64 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Linux 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Linux64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | Standalone: LinuxUniversal 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: x86_64 76 | - first: 77 | Standalone: OSXUniversal 78 | second: 79 | enabled: 0 80 | settings: 81 | CPU: None 82 | - first: 83 | Standalone: Win 84 | second: 85 | enabled: 1 86 | settings: 87 | CPU: AnyCPU 88 | - first: 89 | Standalone: Win64 90 | second: 91 | enabled: 1 92 | settings: 93 | CPU: AnyCPU 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /Assets/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ef6ed0bb9b65454486e23adb227a1c0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MacOS/Plasma.bundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/TextureUpdateExample/08f1b1441957b8490e5cc1104ad6f0054d852659/Assets/MacOS/Plasma.bundle -------------------------------------------------------------------------------- /Assets/MacOS/Plasma.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88bbc70345eae414fbf067c64358cb83 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 0 22 | Exclude Win: 1 23 | Exclude Win64: 1 24 | - first: 25 | Any: 26 | second: 27 | enabled: 0 28 | settings: {} 29 | - first: 30 | Editor: Editor 31 | second: 32 | enabled: 1 33 | settings: 34 | CPU: AnyCPU 35 | DefaultValueInitialized: true 36 | OS: OSX 37 | - first: 38 | Standalone: Linux64 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: None 43 | - first: 44 | Standalone: OSXUniversal 45 | second: 46 | enabled: 1 47 | settings: 48 | CPU: AnyCPU 49 | - first: 50 | Standalone: Win 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: x86 55 | - first: 56 | Standalone: Win64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: x86_64 61 | userData: 62 | assetBundleName: 63 | assetBundleVariant: 64 | -------------------------------------------------------------------------------- /Assets/Test.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Rendering; 3 | 4 | public class Test : MonoBehaviour 5 | { 6 | Texture2D _texture; 7 | CommandBuffer _command; 8 | 9 | #if PLATFORM_IOS 10 | [System.Runtime.InteropServices.DllImport("__Internal")] 11 | #else 12 | [System.Runtime.InteropServices.DllImport("Plasma")] 13 | #endif 14 | static extern System.IntPtr GetTextureUpdateCallback(); 15 | 16 | void Start() 17 | { 18 | _command = new CommandBuffer(); 19 | _texture = new Texture2D(64, 64, TextureFormat.RGBA32, false); 20 | _texture.wrapMode = TextureWrapMode.Clamp; 21 | 22 | // Set the texture to the renderer with using a property block. 23 | var prop = new MaterialPropertyBlock(); 24 | prop.SetTexture("_MainTex", _texture); 25 | GetComponent().SetPropertyBlock(prop); 26 | } 27 | 28 | void OnDestroy() 29 | { 30 | _command.Dispose(); 31 | Destroy(_texture); 32 | } 33 | 34 | void Update() 35 | { 36 | // Request texture update via the command buffer. 37 | _command.IssuePluginCustomTextureUpdateV2( 38 | GetTextureUpdateCallback(), _texture, (uint)(Time.time * 60) 39 | ); 40 | Graphics.ExecuteCommandBuffer(_command); 41 | _command.Clear(); 42 | 43 | // Rotation 44 | transform.eulerAngles = new Vector3(10, 20, 30) * Time.time; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Test.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f3034ffa3a953f4b88053eaaba5b078 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Test.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: 1 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 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: 0 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: 1 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: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 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: 994952784} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 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 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &348385670 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: 348385672} 135 | - component: {fileID: 348385671} 136 | m_Layer: 0 137 | m_Name: Main Camera 138 | m_TagString: MainCamera 139 | m_Icon: {fileID: 0} 140 | m_NavMeshLayer: 0 141 | m_StaticEditorFlags: 0 142 | m_IsActive: 1 143 | --- !u!20 &348385671 144 | Camera: 145 | m_ObjectHideFlags: 0 146 | m_CorrespondingSourceObject: {fileID: 0} 147 | m_PrefabInstance: {fileID: 0} 148 | m_PrefabAsset: {fileID: 0} 149 | m_GameObject: {fileID: 348385670} 150 | m_Enabled: 1 151 | serializedVersion: 2 152 | m_ClearFlags: 2 153 | m_BackGroundColor: {r: 0.1504539, g: 0.17632559, b: 0.21698111, a: 0} 154 | m_projectionMatrixMode: 1 155 | m_GateFitMode: 2 156 | m_FOVAxisMode: 0 157 | m_SensorSize: {x: 36, y: 24} 158 | m_LensShift: {x: 0, y: 0} 159 | m_FocalLength: 50 160 | m_NormalizedViewPortRect: 161 | serializedVersion: 2 162 | x: 0 163 | y: 0 164 | width: 1 165 | height: 1 166 | near clip plane: 0.3 167 | far clip plane: 1000 168 | field of view: 60 169 | orthographic: 0 170 | orthographic size: 5 171 | m_Depth: -1 172 | m_CullingMask: 173 | serializedVersion: 2 174 | m_Bits: 4294967295 175 | m_RenderingPath: 1 176 | m_TargetTexture: {fileID: 0} 177 | m_TargetDisplay: 0 178 | m_TargetEye: 3 179 | m_HDR: 0 180 | m_AllowMSAA: 0 181 | m_AllowDynamicResolution: 0 182 | m_ForceIntoRT: 0 183 | m_OcclusionCulling: 0 184 | m_StereoConvergence: 10 185 | m_StereoSeparation: 0.022 186 | --- !u!4 &348385672 187 | Transform: 188 | m_ObjectHideFlags: 0 189 | m_CorrespondingSourceObject: {fileID: 0} 190 | m_PrefabInstance: {fileID: 0} 191 | m_PrefabAsset: {fileID: 0} 192 | m_GameObject: {fileID: 348385670} 193 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 194 | m_LocalPosition: {x: 0, y: 0, z: -1.8} 195 | m_LocalScale: {x: 1, y: 1, z: 1} 196 | m_Children: [] 197 | m_Father: {fileID: 0} 198 | m_RootOrder: 0 199 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 200 | --- !u!1 &772004367 201 | GameObject: 202 | m_ObjectHideFlags: 0 203 | m_CorrespondingSourceObject: {fileID: 0} 204 | m_PrefabInstance: {fileID: 0} 205 | m_PrefabAsset: {fileID: 0} 206 | serializedVersion: 6 207 | m_Component: 208 | - component: {fileID: 772004370} 209 | - component: {fileID: 772004369} 210 | - component: {fileID: 772004368} 211 | - component: {fileID: 772004371} 212 | m_Layer: 0 213 | m_Name: Cube 214 | m_TagString: Untagged 215 | m_Icon: {fileID: 0} 216 | m_NavMeshLayer: 0 217 | m_StaticEditorFlags: 0 218 | m_IsActive: 1 219 | --- !u!23 &772004368 220 | MeshRenderer: 221 | m_ObjectHideFlags: 0 222 | m_CorrespondingSourceObject: {fileID: 0} 223 | m_PrefabInstance: {fileID: 0} 224 | m_PrefabAsset: {fileID: 0} 225 | m_GameObject: {fileID: 772004367} 226 | m_Enabled: 1 227 | m_CastShadows: 1 228 | m_ReceiveShadows: 1 229 | m_DynamicOccludee: 1 230 | m_MotionVectors: 1 231 | m_LightProbeUsage: 1 232 | m_ReflectionProbeUsage: 1 233 | m_RayTracingMode: 2 234 | m_RayTraceProcedural: 0 235 | m_RenderingLayerMask: 4294967295 236 | m_RendererPriority: 0 237 | m_Materials: 238 | - {fileID: 2100000, guid: 07ce45cfafb36b94e95ee6f146e1bab8, type: 2} 239 | m_StaticBatchInfo: 240 | firstSubMesh: 0 241 | subMeshCount: 0 242 | m_StaticBatchRoot: {fileID: 0} 243 | m_ProbeAnchor: {fileID: 0} 244 | m_LightProbeVolumeOverride: {fileID: 0} 245 | m_ScaleInLightmap: 1 246 | m_ReceiveGI: 1 247 | m_PreserveUVs: 0 248 | m_IgnoreNormalsForChartDetection: 0 249 | m_ImportantGI: 0 250 | m_StitchLightmapSeams: 0 251 | m_SelectedEditorRenderState: 3 252 | m_MinimumChartSize: 4 253 | m_AutoUVMaxDistance: 0.5 254 | m_AutoUVMaxAngle: 89 255 | m_LightmapParameters: {fileID: 0} 256 | m_SortingLayerID: 0 257 | m_SortingLayer: 0 258 | m_SortingOrder: 0 259 | m_AdditionalVertexStreams: {fileID: 0} 260 | --- !u!33 &772004369 261 | MeshFilter: 262 | m_ObjectHideFlags: 0 263 | m_CorrespondingSourceObject: {fileID: 0} 264 | m_PrefabInstance: {fileID: 0} 265 | m_PrefabAsset: {fileID: 0} 266 | m_GameObject: {fileID: 772004367} 267 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 268 | --- !u!4 &772004370 269 | Transform: 270 | m_ObjectHideFlags: 0 271 | m_CorrespondingSourceObject: {fileID: 0} 272 | m_PrefabInstance: {fileID: 0} 273 | m_PrefabAsset: {fileID: 0} 274 | m_GameObject: {fileID: 772004367} 275 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 276 | m_LocalPosition: {x: 0, y: 0, z: 0} 277 | m_LocalScale: {x: 1, y: 1, z: 1} 278 | m_Children: [] 279 | m_Father: {fileID: 0} 280 | m_RootOrder: 1 281 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 282 | --- !u!114 &772004371 283 | MonoBehaviour: 284 | m_ObjectHideFlags: 0 285 | m_CorrespondingSourceObject: {fileID: 0} 286 | m_PrefabInstance: {fileID: 0} 287 | m_PrefabAsset: {fileID: 0} 288 | m_GameObject: {fileID: 772004367} 289 | m_Enabled: 1 290 | m_EditorHideFlags: 0 291 | m_Script: {fileID: 11500000, guid: 5f3034ffa3a953f4b88053eaaba5b078, type: 3} 292 | m_Name: 293 | m_EditorClassIdentifier: 294 | --- !u!850595691 &994952784 295 | LightingSettings: 296 | m_ObjectHideFlags: 0 297 | m_CorrespondingSourceObject: {fileID: 0} 298 | m_PrefabInstance: {fileID: 0} 299 | m_PrefabAsset: {fileID: 0} 300 | m_Name: Settings.lighting 301 | serializedVersion: 3 302 | m_GIWorkflowMode: 0 303 | m_EnableBakedLightmaps: 1 304 | m_EnableRealtimeLightmaps: 1 305 | m_RealtimeEnvironmentLighting: 1 306 | m_BounceScale: 1 307 | m_AlbedoBoost: 1 308 | m_IndirectOutputScale: 1 309 | m_UsingShadowmask: 1 310 | m_BakeBackend: 1 311 | m_LightmapMaxSize: 1024 312 | m_BakeResolution: 40 313 | m_Padding: 2 314 | m_TextureCompression: 1 315 | m_AO: 0 316 | m_AOMaxDistance: 1 317 | m_CompAOExponent: 1 318 | m_CompAOExponentDirect: 0 319 | m_ExtractAO: 0 320 | m_MixedBakeMode: 2 321 | m_LightmapsBakeMode: 1 322 | m_FilterMode: 1 323 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 324 | m_ExportTrainingData: 0 325 | m_TrainingDataDestination: TrainingData 326 | m_RealtimeResolution: 2 327 | m_ForceWhiteAlbedo: 0 328 | m_ForceUpdates: 0 329 | m_FinalGather: 0 330 | m_FinalGatherRayCount: 256 331 | m_FinalGatherFiltering: 1 332 | m_PVRCulling: 1 333 | m_PVRSampling: 1 334 | m_PVRDirectSampleCount: 32 335 | m_PVRSampleCount: 500 336 | m_PVREnvironmentSampleCount: 500 337 | m_PVREnvironmentReferencePointCount: 2048 338 | m_LightProbeSampleCountMultiplier: 4 339 | m_PVRBounces: 2 340 | m_PVRMinBounces: 2 341 | m_PVREnvironmentMIS: 0 342 | m_PVRFilteringMode: 2 343 | m_PVRDenoiserTypeDirect: 0 344 | m_PVRDenoiserTypeIndirect: 0 345 | m_PVRDenoiserTypeAO: 0 346 | m_PVRFilterTypeDirect: 0 347 | m_PVRFilterTypeIndirect: 0 348 | m_PVRFilterTypeAO: 0 349 | m_PVRFilteringGaussRadiusDirect: 1 350 | m_PVRFilteringGaussRadiusIndirect: 5 351 | m_PVRFilteringGaussRadiusAO: 2 352 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 353 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 354 | m_PVRFilteringAtrousPositionSigmaAO: 1 355 | -------------------------------------------------------------------------------- /Assets/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15a60030805958945bd46e0afff66ff1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cac0ac902ce9b154ea998ba14b09e049 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Windows/Plasma.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/TextureUpdateExample/08f1b1441957b8490e5cc1104ad6f0054d852659/Assets/Windows/Plasma.dll -------------------------------------------------------------------------------- /Assets/Windows/Plasma.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed8ae1bd6f2973b47b492585fae2c15c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | isOverridable: 0 10 | platformData: 11 | - first: 12 | '': Any 13 | second: 14 | enabled: 0 15 | settings: 16 | Exclude Editor: 0 17 | Exclude Linux: 0 18 | Exclude Linux64: 0 19 | Exclude LinuxUniversal: 0 20 | Exclude OSXUniversal: 0 21 | Exclude Win: 1 22 | Exclude Win64: 0 23 | - first: 24 | Any: 25 | second: 26 | enabled: 0 27 | settings: {} 28 | - first: 29 | Editor: Editor 30 | second: 31 | enabled: 1 32 | settings: 33 | CPU: x86_64 34 | DefaultValueInitialized: true 35 | OS: Windows 36 | - first: 37 | Facebook: Win 38 | second: 39 | enabled: 0 40 | settings: 41 | CPU: None 42 | - first: 43 | Facebook: Win64 44 | second: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | - first: 49 | Standalone: Linux 50 | second: 51 | enabled: 1 52 | settings: 53 | CPU: x86 54 | - first: 55 | Standalone: Linux64 56 | second: 57 | enabled: 1 58 | settings: 59 | CPU: x86_64 60 | - first: 61 | Standalone: LinuxUniversal 62 | second: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | - first: 67 | Standalone: OSXUniversal 68 | second: 69 | enabled: 1 70 | settings: 71 | CPU: AnyCPU 72 | - first: 73 | Standalone: Win 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: None 78 | - first: 79 | Standalone: Win64 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: AnyCPU 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Assets/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ca396e72b16b4d60ad2a046a4636652 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/iOS/libPlasma.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/TextureUpdateExample/08f1b1441957b8490e5cc1104ad6f0054d852659/Assets/iOS/libPlasma.a -------------------------------------------------------------------------------- /Assets/iOS/libPlasma.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b6d7a1cbcbeb4b4bb67d11ef24b04d0 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 1 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 1 22 | Exclude Win: 1 23 | Exclude Win64: 1 24 | Exclude iOS: 0 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | DefaultValueInitialized: true 37 | OS: AnyOS 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: None 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | - first: 63 | iPhone: iOS 64 | second: 65 | enabled: 1 66 | settings: 67 | AddToEmbeddedBinaries: false 68 | CPU: ARM64 69 | CompileFlags: 70 | FrameworkDependencies: 71 | userData: 72 | assetBundleName: 73 | assetBundleVariant: 74 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": {} 3 | } 4 | -------------------------------------------------------------------------------- /Plugin/Android/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BIN_PATH="$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin" 4 | 5 | CC="$BIN_PATH/aarch64-linux-android28-clang" 6 | STRIP="$BIN_PATH/aarch64-linux-android-strip" 7 | 8 | CCFLAGS="-O2 -Wall -shared -rdynamic -fPIC" 9 | 10 | $CC $CCFLAGS ../Plasma.c -lm -o libPlasma.so 11 | $STRIP libPlasma.so 12 | -------------------------------------------------------------------------------- /Plugin/Linux/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FLAGS="-O2 -Wall -shared -rdynamic -fPIC" 4 | 5 | gcc $FLAGS ../Plasma.c -o libPlasma.so 6 | -------------------------------------------------------------------------------- /Plugin/MacOS/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FLAGS="-O2 -Wall -shared -rdynamic -fPIC" 4 | 5 | gcc -target x86_64-apple-macos10.12 $FLAGS ../Plasma.c -o x86_64.so 6 | gcc -target arm64-apple-macos10.12 $FLAGS ../Plasma.c -o arm64.so 7 | 8 | lipo -create -output Plasma.bundle x86_64.so arm64.so 9 | -------------------------------------------------------------------------------- /Plugin/Plasma.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "Unity/IUnityRenderingExtensions.h" 5 | 6 | // Old school plasma effect 7 | uint32_t Plasma(int x, int y, int width, int height, unsigned int frame) 8 | { 9 | float px = (float)x / width; 10 | float py = (float)y / height; 11 | float time = frame / 60.0f; 12 | 13 | float l = sinf(px * sinf(time * 1.3f) + sinf(py * 4 + time) * sinf(time)); 14 | 15 | uint32_t r = sinf(l * 6) * 127 + 127; 16 | uint32_t g = sinf(l * 7) * 127 + 127; 17 | uint32_t b = sinf(l * 10) * 127 + 127; 18 | 19 | return r + (g << 8) + (b << 16) + 0xff000000u; 20 | } 21 | 22 | // Callback for texture update events 23 | void TextureUpdateCallback(int eventID, void *data) 24 | { 25 | if (eventID == kUnityRenderingExtEventUpdateTextureBeginV2) 26 | { 27 | // UpdateTextureBegin: Generate and return texture image data. 28 | UnityRenderingExtTextureUpdateParamsV2 *params = data; 29 | unsigned int frame = params->userData; 30 | 31 | uint32_t *img = malloc(params->width * params->height * 4); 32 | for (int y = 0; y < params->height; y++) 33 | for (int x = 0; x < params->width; x++) 34 | img[y * params->width + x] = 35 | Plasma(x, y, params->width, params->height, frame); 36 | 37 | params->texData = img; 38 | } 39 | else if (eventID == kUnityRenderingExtEventUpdateTextureEndV2) 40 | { 41 | // UpdateTextureEnd: Free up the temporary memory. 42 | UnityRenderingExtTextureUpdateParamsV2 *params = data; 43 | free(params->texData); 44 | } 45 | } 46 | 47 | UnityRenderingEventAndData UNITY_INTERFACE_EXPORT GetTextureUpdateCallback() 48 | { 49 | return TextureUpdateCallback; 50 | } 51 | -------------------------------------------------------------------------------- /Plugin/Unity/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 | -------------------------------------------------------------------------------- /Plugin/Unity/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 | -------------------------------------------------------------------------------- /Plugin/Unity/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 | } UnityRenderingExtQueryType; 114 | 115 | 116 | typedef enum UnityRenderingExtTextureFormat 117 | { 118 | kUnityRenderingExtFormatNone = 0, kUnityRenderingExtFormatFirst = kUnityRenderingExtFormatNone, 119 | 120 | // sRGB formats 121 | kUnityRenderingExtFormatR8_SRGB, 122 | kUnityRenderingExtFormatR8G8_SRGB, 123 | kUnityRenderingExtFormatR8G8B8_SRGB, 124 | kUnityRenderingExtFormatR8G8B8A8_SRGB, 125 | 126 | // 8 bit integer formats 127 | kUnityRenderingExtFormatR8_UNorm, 128 | kUnityRenderingExtFormatR8G8_UNorm, 129 | kUnityRenderingExtFormatR8G8B8_UNorm, 130 | kUnityRenderingExtFormatR8G8B8A8_UNorm, 131 | kUnityRenderingExtFormatR8_SNorm, 132 | kUnityRenderingExtFormatR8G8_SNorm, 133 | kUnityRenderingExtFormatR8G8B8_SNorm, 134 | kUnityRenderingExtFormatR8G8B8A8_SNorm, 135 | kUnityRenderingExtFormatR8_UInt, 136 | kUnityRenderingExtFormatR8G8_UInt, 137 | kUnityRenderingExtFormatR8G8B8_UInt, 138 | kUnityRenderingExtFormatR8G8B8A8_UInt, 139 | kUnityRenderingExtFormatR8_SInt, 140 | kUnityRenderingExtFormatR8G8_SInt, 141 | kUnityRenderingExtFormatR8G8B8_SInt, 142 | kUnityRenderingExtFormatR8G8B8A8_SInt, 143 | 144 | // 16 bit integer formats 145 | kUnityRenderingExtFormatR16_UNorm, 146 | kUnityRenderingExtFormatR16G16_UNorm, 147 | kUnityRenderingExtFormatR16G16B16_UNorm, 148 | kUnityRenderingExtFormatR16G16B16A16_UNorm, 149 | kUnityRenderingExtFormatR16_SNorm, 150 | kUnityRenderingExtFormatR16G16_SNorm, 151 | kUnityRenderingExtFormatR16G16B16_SNorm, 152 | kUnityRenderingExtFormatR16G16B16A16_SNorm, 153 | kUnityRenderingExtFormatR16_UInt, 154 | kUnityRenderingExtFormatR16G16_UInt, 155 | kUnityRenderingExtFormatR16G16B16_UInt, 156 | kUnityRenderingExtFormatR16G16B16A16_UInt, 157 | kUnityRenderingExtFormatR16_SInt, 158 | kUnityRenderingExtFormatR16G16_SInt, 159 | kUnityRenderingExtFormatR16G16B16_SInt, 160 | kUnityRenderingExtFormatR16G16B16A16_SInt, 161 | 162 | // 32 bit integer formats 163 | kUnityRenderingExtFormatR32_UInt, 164 | kUnityRenderingExtFormatR32G32_UInt, 165 | kUnityRenderingExtFormatR32G32B32_UInt, 166 | kUnityRenderingExtFormatR32G32B32A32_UInt, 167 | kUnityRenderingExtFormatR32_SInt, 168 | kUnityRenderingExtFormatR32G32_SInt, 169 | kUnityRenderingExtFormatR32G32B32_SInt, 170 | kUnityRenderingExtFormatR32G32B32A32_SInt, 171 | 172 | // HDR formats 173 | kUnityRenderingExtFormatR16_SFloat, 174 | kUnityRenderingExtFormatR16G16_SFloat, 175 | kUnityRenderingExtFormatR16G16B16_SFloat, 176 | kUnityRenderingExtFormatR16G16B16A16_SFloat, 177 | kUnityRenderingExtFormatR32_SFloat, 178 | kUnityRenderingExtFormatR32G32_SFloat, 179 | kUnityRenderingExtFormatR32G32B32_SFloat, 180 | kUnityRenderingExtFormatR32G32B32A32_SFloat, 181 | 182 | // Luminance and Alpha format 183 | kUnityRenderingExtFormatL8_UNorm, 184 | kUnityRenderingExtFormatA8_UNorm, 185 | kUnityRenderingExtFormatA16_UNorm, 186 | 187 | // BGR formats 188 | kUnityRenderingExtFormatB8G8R8_SRGB, 189 | kUnityRenderingExtFormatB8G8R8A8_SRGB, 190 | kUnityRenderingExtFormatB8G8R8_UNorm, 191 | kUnityRenderingExtFormatB8G8R8A8_UNorm, 192 | kUnityRenderingExtFormatB8G8R8_SNorm, 193 | kUnityRenderingExtFormatB8G8R8A8_SNorm, 194 | kUnityRenderingExtFormatB8G8R8_UInt, 195 | kUnityRenderingExtFormatB8G8R8A8_UInt, 196 | kUnityRenderingExtFormatB8G8R8_SInt, 197 | kUnityRenderingExtFormatB8G8R8A8_SInt, 198 | 199 | // 16 bit packed formats 200 | kUnityRenderingExtFormatR4G4B4A4_UNormPack16, 201 | kUnityRenderingExtFormatB4G4R4A4_UNormPack16, 202 | kUnityRenderingExtFormatR5G6B5_UNormPack16, 203 | kUnityRenderingExtFormatB5G6R5_UNormPack16, 204 | kUnityRenderingExtFormatR5G5B5A1_UNormPack16, 205 | kUnityRenderingExtFormatB5G5R5A1_UNormPack16, 206 | kUnityRenderingExtFormatA1R5G5B5_UNormPack16, 207 | 208 | // Packed formats 209 | kUnityRenderingExtFormatE5B9G9R9_UFloatPack32, 210 | kUnityRenderingExtFormatB10G11R11_UFloatPack32, 211 | 212 | kUnityRenderingExtFormatA2B10G10R10_UNormPack32, 213 | kUnityRenderingExtFormatA2B10G10R10_UIntPack32, 214 | kUnityRenderingExtFormatA2B10G10R10_SIntPack32, 215 | kUnityRenderingExtFormatA2R10G10B10_UNormPack32, 216 | kUnityRenderingExtFormatA2R10G10B10_UIntPack32, 217 | kUnityRenderingExtFormatA2R10G10B10_SIntPack32, 218 | kUnityRenderingExtFormatA2R10G10B10_XRSRGBPack32, 219 | kUnityRenderingExtFormatA2R10G10B10_XRUNormPack32, 220 | kUnityRenderingExtFormatR10G10B10_XRSRGBPack32, 221 | kUnityRenderingExtFormatR10G10B10_XRUNormPack32, 222 | kUnityRenderingExtFormatA10R10G10B10_XRSRGBPack32, 223 | kUnityRenderingExtFormatA10R10G10B10_XRUNormPack32, 224 | 225 | // ARGB formats... TextureFormat legacy 226 | kUnityRenderingExtFormatA8R8G8B8_SRGB, 227 | kUnityRenderingExtFormatA8R8G8B8_UNorm, 228 | kUnityRenderingExtFormatA32R32G32B32_SFloat, 229 | 230 | // Depth Stencil for formats 231 | kUnityRenderingExtFormatD16_UNorm, 232 | kUnityRenderingExtFormatD24_UNorm, 233 | kUnityRenderingExtFormatD24_UNorm_S8_UInt, 234 | kUnityRenderingExtFormatD32_SFloat, 235 | kUnityRenderingExtFormatD32_SFloat_S8_Uint, 236 | kUnityRenderingExtFormatS8_Uint, 237 | 238 | // Compression formats 239 | kUnityRenderingExtFormatRGBA_DXT1_SRGB, 240 | kUnityRenderingExtFormatRGBA_DXT1_UNorm, 241 | kUnityRenderingExtFormatRGBA_DXT3_SRGB, 242 | kUnityRenderingExtFormatRGBA_DXT3_UNorm, 243 | kUnityRenderingExtFormatRGBA_DXT5_SRGB, 244 | kUnityRenderingExtFormatRGBA_DXT5_UNorm, 245 | kUnityRenderingExtFormatR_BC4_UNorm, 246 | kUnityRenderingExtFormatR_BC4_SNorm, 247 | kUnityRenderingExtFormatRG_BC5_UNorm, 248 | kUnityRenderingExtFormatRG_BC5_SNorm, 249 | kUnityRenderingExtFormatRGB_BC6H_UFloat, 250 | kUnityRenderingExtFormatRGB_BC6H_SFloat, 251 | kUnityRenderingExtFormatRGBA_BC7_SRGB, 252 | kUnityRenderingExtFormatRGBA_BC7_UNorm, 253 | 254 | kUnityRenderingExtFormatRGB_PVRTC_2Bpp_SRGB, 255 | kUnityRenderingExtFormatRGB_PVRTC_2Bpp_UNorm, 256 | kUnityRenderingExtFormatRGB_PVRTC_4Bpp_SRGB, 257 | kUnityRenderingExtFormatRGB_PVRTC_4Bpp_UNorm, 258 | kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_SRGB, 259 | kUnityRenderingExtFormatRGBA_PVRTC_2Bpp_UNorm, 260 | kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_SRGB, 261 | kUnityRenderingExtFormatRGBA_PVRTC_4Bpp_UNorm, 262 | 263 | kUnityRenderingExtFormatRGB_ETC_UNorm, 264 | kUnityRenderingExtFormatRGB_ETC2_SRGB, 265 | kUnityRenderingExtFormatRGB_ETC2_UNorm, 266 | kUnityRenderingExtFormatRGB_A1_ETC2_SRGB, 267 | kUnityRenderingExtFormatRGB_A1_ETC2_UNorm, 268 | kUnityRenderingExtFormatRGBA_ETC2_SRGB, 269 | kUnityRenderingExtFormatRGBA_ETC2_UNorm, 270 | 271 | kUnityRenderingExtFormatR_EAC_UNorm, 272 | kUnityRenderingExtFormatR_EAC_SNorm, 273 | kUnityRenderingExtFormatRG_EAC_UNorm, 274 | kUnityRenderingExtFormatRG_EAC_SNorm, 275 | 276 | kUnityRenderingExtFormatRGBA_ASTC4X4_SRGB, 277 | kUnityRenderingExtFormatRGBA_ASTC4X4_UNorm, 278 | kUnityRenderingExtFormatRGBA_ASTC5X5_SRGB, 279 | kUnityRenderingExtFormatRGBA_ASTC5X5_UNorm, 280 | kUnityRenderingExtFormatRGBA_ASTC6X6_SRGB, 281 | kUnityRenderingExtFormatRGBA_ASTC6X6_UNorm, 282 | kUnityRenderingExtFormatRGBA_ASTC8X8_SRGB, 283 | kUnityRenderingExtFormatRGBA_ASTC8X8_UNorm, 284 | kUnityRenderingExtFormatRGBA_ASTC10X10_SRGB, 285 | kUnityRenderingExtFormatRGBA_ASTC10X10_UNorm, 286 | kUnityRenderingExtFormatRGBA_ASTC12X12_SRGB, 287 | kUnityRenderingExtFormatRGBA_ASTC12X12_UNorm, 288 | 289 | // Video formats 290 | kUnityRenderingExtFormatYUV2, 291 | 292 | // Automatic formats, back-end decides 293 | kUnityRenderingExtFormatDepthAuto, 294 | kUnityRenderingExtFormatShadowAuto, 295 | kUnityRenderingExtFormatVideoAuto, 296 | 297 | // ASTC hdr profile 298 | kUnityRenderingExtFormatRGBA_ASTC4X4_UFloat, 299 | kUnityRenderingExtFormatRGBA_ASTC5X5_UFloat, 300 | kUnityRenderingExtFormatRGBA_ASTC6X6_UFloat, 301 | kUnityRenderingExtFormatRGBA_ASTC8X8_UFloat, 302 | kUnityRenderingExtFormatRGBA_ASTC10X10_UFloat, 303 | kUnityRenderingExtFormatRGBA_ASTC12X12_UFloat, 304 | 305 | kUnityRenderingExtFormatLast = kUnityRenderingExtFormatRGBA_ASTC12X12_UFloat, // Remove? 306 | } UnityRenderingExtTextureFormat; 307 | 308 | 309 | typedef struct UnityRenderingExtBeforeDrawCallParams 310 | { 311 | void* vertexShader; // bound vertex shader (platform dependent) 312 | void* fragmentShader; // bound fragment shader (platform dependent) 313 | void* geometryShader; // bound geometry shader (platform dependent) 314 | void* hullShader; // bound hull shader (platform dependent) 315 | void* domainShader; // bound domain shader (platform dependent) 316 | int eyeIndex; // the index of the current stereo "eye" being currently rendered. 317 | } UnityRenderingExtBeforeDrawCallParams; 318 | 319 | 320 | typedef struct UnityRenderingExtCustomBlitParams 321 | { 322 | UnityTextureID source; // source texture 323 | UnityRenderBuffer destination; // destination surface 324 | unsigned int command; // command for the custom blit - could be any UnityRenderingExtCustomBlitCommands command or custom ones. 325 | unsigned int commandParam; // custom parameters for the command 326 | unsigned int commandFlags; // custom flags for the command 327 | } UnityRenderingExtCustomBlitParams; 328 | 329 | // Deprecated. Use UnityRenderingExtTextureUpdateParamsV2 and CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. 330 | // Only supports DX11, GLES, Metal 331 | typedef struct UnityRenderingExtTextureUpdateParamsV1 332 | { 333 | void* texData; // source data for the texture update. Must be set by the plugin 334 | unsigned int userData; // user defined data. Set by the plugin 335 | 336 | unsigned int textureID; // texture ID of the texture to be updated. 337 | UnityRenderingExtTextureFormat format; // format of the texture to be updated 338 | unsigned int width; // width of the texture 339 | unsigned int height; // height of the texture 340 | unsigned int bpp; // texture bytes per pixel. 341 | } UnityRenderingExtTextureUpdateParamsV1; 342 | 343 | // Deprecated. Use UnityRenderingExtTextureUpdateParamsV2 and CommandBuffer.IssuePluginCustomTextureUpdateV2 instead. 344 | // Only supports DX11, GLES, Metal 345 | typedef UnityRenderingExtTextureUpdateParamsV1 UnityRenderingExtTextureUpdateParams; 346 | 347 | // Type of the "data" parameter passed when callbacks registered with CommandBuffer.IssuePluginCustomTextureUpdateV2 are called. 348 | // Supports DX11, GLES, Metal, and Switch (also possibly PS4, PSVita in the future) 349 | typedef struct UnityRenderingExtTextureUpdateParamsV2 350 | { 351 | void* texData; // source data for the texture update. Must be set by the plugin 352 | intptr_t textureID; // texture ID of the texture to be updated. 353 | unsigned int userData; // user defined data. Set by the plugin 354 | UnityRenderingExtTextureFormat format; // format of the texture to be updated 355 | unsigned int width; // width of the texture 356 | unsigned int height; // height of the texture 357 | unsigned int bpp; // texture bytes per pixel. 358 | } UnityRenderingExtTextureUpdateParamsV2; 359 | 360 | 361 | // Certain Unity APIs (GL.IssuePluginEventAndData, CommandBuffer.IssuePluginEventAndData) can callback into native plugins. 362 | // Provide them with an address to a function of this signature. 363 | typedef void (UNITY_INTERFACE_API * UnityRenderingEventAndData)(int eventId, void* data); 364 | 365 | 366 | #ifdef __cplusplus 367 | extern "C" { 368 | #endif 369 | 370 | // If exported by a plugin, this function will be called for all the events in UnityRenderingExtEventType 371 | void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtEvent(UnityRenderingExtEventType event, void* data); 372 | // If exported by a plugin, this function will be called to query the plugin for the queries in UnityRenderingExtQueryType 373 | //bool UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityRenderingExtQuery(UnityRenderingExtQueryType query); 374 | 375 | #ifdef __cplusplus 376 | } 377 | #endif 378 | -------------------------------------------------------------------------------- /Plugin/Windows/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains a build script that works on the WSL/WSL2 environments. 2 | You need to install mingw-w64 before running it. 3 | -------------------------------------------------------------------------------- /Plugin/Windows/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FLAGS="-O2 -Wall -shared" 4 | 5 | x86_64-w64-mingw32-gcc $FLAGS ../Plasma.c -o Plasma.dll 6 | 7 | x86_64-w64-mingw32-strip Plasma.dll 8 | -------------------------------------------------------------------------------- /Plugin/iOS/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SYSROOT=`xcrun --sdk iphoneos --show-sdk-path` 4 | FLAGS="-O2 -Wall --sysroot $SYSROOT -isysroot $SYSROOT -fembed-bitcode" 5 | 6 | gcc $FLAGS -c ../Plasma.c 7 | 8 | ar -crv libPlasma.a Plasma.o 9 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Test.unity 10 | guid: 15a60030805958945bd46e0afff66ff1 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 1 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref 19 | m_ProjectGenerationRootNamespace: 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 1 24 | m_PrefabModeAllowAutoSave: 1 25 | m_EnterPlayModeOptionsEnabled: 1 26 | m_EnterPlayModeOptions: 3 27 | m_GameObjectNamingDigits: 1 28 | m_GameObjectNamingScheme: 0 29 | m_AssetNamingUsesSpace: 1 30 | m_UseLegacyProbeSampleCount: 1 31 | m_SerializeInlineMappingsOnOneLine: 0 32 | m_DisableCookiesInLightmapper: 1 33 | m_AssetPipelineMode: 1 34 | m_CacheServerMode: 0 35 | m_CacheServerEndpoint: 36 | m_CacheServerNamespacePrefix: default 37 | m_CacheServerEnableDownload: 1 38 | m_CacheServerEnableUpload: 1 39 | m_CacheServerEnableAuth: 0 40 | m_CacheServerEnableTls: 0 41 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 22 7 | productGUID: 8fa36e904da6ae94fb5b31e2cbff450e 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: TextureUpdateExample 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 0 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1920 46 | defaultScreenHeight: 1080 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 0 70 | androidBlitType: 0 71 | defaultIsNativeResolution: 1 72 | macRetinaSupport: 1 73 | runInBackground: 1 74 | captureSingleScreen: 0 75 | muteOtherAudioSources: 0 76 | Prepare IOS For Recording: 0 77 | Force IOS Speakers When Recording: 0 78 | deferSystemGesturesMode: 0 79 | hideHomeButton: 0 80 | submitAnalytics: 1 81 | usePlayerLog: 1 82 | bakeCollisionMeshes: 0 83 | forceSingleInstance: 0 84 | useFlipModelSwapchain: 1 85 | resizableWindow: 0 86 | useMacAppStoreValidation: 0 87 | macAppStoreCategory: public.app-category.games 88 | gpuSkinning: 1 89 | xboxPIXTextureCapture: 0 90 | xboxEnableAvatar: 0 91 | xboxEnableKinect: 0 92 | xboxEnableKinectAutoTracking: 0 93 | xboxEnableFitness: 0 94 | visibleInBackground: 1 95 | allowFullscreenSwitch: 1 96 | fullscreenMode: 3 97 | xboxSpeechDB: 0 98 | xboxEnableHeadOrientation: 0 99 | xboxEnableGuest: 0 100 | xboxEnablePIXSampling: 0 101 | metalFramebufferOnly: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOneEnableTypeOptimization: 0 109 | xboxOnePresentImmediateThreshold: 0 110 | switchQueueCommandMemory: 0 111 | switchQueueControlMemory: 16384 112 | switchQueueComputeMemory: 262144 113 | switchNVNShaderPoolsGranularity: 33554432 114 | switchNVNDefaultPoolsGranularity: 16777216 115 | switchNVNOtherPoolsGranularity: 16777216 116 | switchNVNMaxPublicTextureIDCount: 0 117 | switchNVNMaxPublicSamplerIDCount: 0 118 | stadiaPresentMode: 0 119 | stadiaTargetFramerate: 0 120 | vulkanNumSwapchainBuffers: 3 121 | vulkanEnableSetSRGBWrite: 0 122 | vulkanEnablePreTransform: 0 123 | vulkanEnableLateAcquireNextImage: 0 124 | m_SupportedAspectRatios: 125 | 4:3: 1 126 | 5:4: 1 127 | 16:10: 1 128 | 16:9: 1 129 | Others: 1 130 | bundleVersion: 0.1 131 | preloadedAssets: [] 132 | metroInputSource: 0 133 | wsaTransparentSwapchain: 0 134 | m_HolographicPauseOnTrackingLoss: 1 135 | xboxOneDisableKinectGpuReservation: 0 136 | xboxOneEnable7thCore: 0 137 | vrSettings: 138 | enable360StereoCapture: 0 139 | isWsaHolographicRemotingEnabled: 0 140 | enableFrameTimingStats: 0 141 | useHDRDisplay: 0 142 | D3DHDRBitDepth: 0 143 | m_ColorGamuts: 0000000003000000 144 | targetPixelDensity: 30 145 | resolutionScalingMode: 0 146 | androidSupportedAspectRatio: 1 147 | androidMaxAspectRatio: 2.1 148 | applicationIdentifier: 149 | iPhone: jp.keijiro.textureupdateexample 150 | buildNumber: 151 | Standalone: 0 152 | iPhone: 0 153 | tvOS: 0 154 | overrideDefaultApplicationIdentifier: 1 155 | AndroidBundleVersionCode: 1 156 | AndroidMinSdkVersion: 19 157 | AndroidTargetSdkVersion: 0 158 | AndroidPreferredInstallLocation: 1 159 | aotOptions: 160 | stripEngineCode: 1 161 | iPhoneStrippingLevel: 0 162 | iPhoneScriptCallOptimization: 0 163 | ForceInternetPermission: 0 164 | ForceSDCardPermission: 0 165 | CreateWallpaper: 0 166 | APKExpansionFiles: 0 167 | keepLoadedShadersAlive: 0 168 | StripUnusedMeshComponents: 1 169 | VertexChannelCompressionMask: 4054 170 | iPhoneSdkVersion: 988 171 | iOSTargetOSVersionString: 11.0 172 | tvOSSdkVersion: 0 173 | tvOSRequireExtendedGameController: 0 174 | tvOSTargetOSVersionString: 11.0 175 | uIPrerenderedIcon: 0 176 | uIRequiresPersistentWiFi: 0 177 | uIRequiresFullScreen: 1 178 | uIStatusBarHidden: 1 179 | uIExitOnSuspend: 0 180 | uIStatusBarStyle: 0 181 | appleTVSplashScreen: {fileID: 0} 182 | appleTVSplashScreen2x: {fileID: 0} 183 | tvOSSmallIconLayers: [] 184 | tvOSSmallIconLayers2x: [] 185 | tvOSLargeIconLayers: [] 186 | tvOSLargeIconLayers2x: [] 187 | tvOSTopShelfImageLayers: [] 188 | tvOSTopShelfImageLayers2x: [] 189 | tvOSTopShelfImageWideLayers: [] 190 | tvOSTopShelfImageWideLayers2x: [] 191 | iOSLaunchScreenType: 0 192 | iOSLaunchScreenPortrait: {fileID: 0} 193 | iOSLaunchScreenLandscape: {fileID: 0} 194 | iOSLaunchScreenBackgroundColor: 195 | serializedVersion: 2 196 | rgba: 0 197 | iOSLaunchScreenFillPct: 100 198 | iOSLaunchScreenSize: 100 199 | iOSLaunchScreenCustomXibPath: 200 | iOSLaunchScreeniPadType: 0 201 | iOSLaunchScreeniPadImage: {fileID: 0} 202 | iOSLaunchScreeniPadBackgroundColor: 203 | serializedVersion: 2 204 | rgba: 0 205 | iOSLaunchScreeniPadFillPct: 100 206 | iOSLaunchScreeniPadSize: 100 207 | iOSLaunchScreeniPadCustomXibPath: 208 | iOSLaunchScreenCustomStoryboardPath: 209 | iOSLaunchScreeniPadCustomStoryboardPath: 210 | iOSDeviceRequirements: [] 211 | iOSURLSchemes: [] 212 | iOSBackgroundModes: 0 213 | iOSMetalForceHardShadows: 0 214 | metalEditorSupport: 1 215 | metalAPIValidation: 1 216 | iOSRenderExtraFrameOnPause: 0 217 | iosCopyPluginsCodeInsteadOfSymlink: 0 218 | appleDeveloperTeamID: 219 | iOSManualSigningProvisioningProfileID: 220 | tvOSManualSigningProvisioningProfileID: 221 | iOSManualSigningProvisioningProfileType: 0 222 | tvOSManualSigningProvisioningProfileType: 0 223 | appleEnableAutomaticSigning: 0 224 | iOSRequireARKit: 0 225 | iOSAutomaticallyDetectAndAddCapabilities: 1 226 | appleEnableProMotion: 0 227 | shaderPrecisionModel: 0 228 | clonedFromGUID: 56e7a2d3a00f33d44bdd161b773c35b5 229 | templatePackageId: com.unity.template.3d@1.0.0 230 | templateDefaultScene: Assets/Scenes/SampleScene.unity 231 | useCustomMainManifest: 0 232 | useCustomLauncherManifest: 0 233 | useCustomMainGradleTemplate: 0 234 | useCustomLauncherGradleManifest: 0 235 | useCustomBaseGradleTemplate: 0 236 | useCustomGradlePropertiesTemplate: 0 237 | useCustomProguardFile: 0 238 | AndroidTargetArchitectures: 2 239 | AndroidSplashScreenScale: 0 240 | androidSplashScreen: {fileID: 0} 241 | AndroidKeystoreName: '{inproject}: ' 242 | AndroidKeyaliasName: 243 | AndroidBuildApkPerCpuArchitecture: 0 244 | AndroidTVCompatibility: 1 245 | AndroidIsGame: 1 246 | AndroidEnableTango: 0 247 | androidEnableBanner: 1 248 | androidUseLowAccuracyLocation: 0 249 | androidUseCustomKeystore: 0 250 | m_AndroidBanners: 251 | - width: 320 252 | height: 180 253 | banner: {fileID: 0} 254 | androidGamepadSupportLevel: 0 255 | AndroidMinifyWithR8: 0 256 | AndroidMinifyRelease: 0 257 | AndroidMinifyDebug: 0 258 | AndroidValidateAppBundleSize: 1 259 | AndroidAppBundleSizeToValidate: 150 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: 262 | - m_BuildTarget: Android 263 | m_Icons: 264 | - m_Textures: [] 265 | m_Width: 432 266 | m_Height: 432 267 | m_Kind: 2 268 | m_SubKind: 269 | - m_Textures: [] 270 | m_Width: 324 271 | m_Height: 324 272 | m_Kind: 2 273 | m_SubKind: 274 | - m_Textures: [] 275 | m_Width: 216 276 | m_Height: 216 277 | m_Kind: 2 278 | m_SubKind: 279 | - m_Textures: [] 280 | m_Width: 162 281 | m_Height: 162 282 | m_Kind: 2 283 | m_SubKind: 284 | - m_Textures: [] 285 | m_Width: 108 286 | m_Height: 108 287 | m_Kind: 2 288 | m_SubKind: 289 | - m_Textures: [] 290 | m_Width: 81 291 | m_Height: 81 292 | m_Kind: 2 293 | m_SubKind: 294 | - m_Textures: [] 295 | m_Width: 192 296 | m_Height: 192 297 | m_Kind: 0 298 | m_SubKind: 299 | - m_Textures: [] 300 | m_Width: 144 301 | m_Height: 144 302 | m_Kind: 0 303 | m_SubKind: 304 | - m_Textures: [] 305 | m_Width: 96 306 | m_Height: 96 307 | m_Kind: 0 308 | m_SubKind: 309 | - m_Textures: [] 310 | m_Width: 72 311 | m_Height: 72 312 | m_Kind: 0 313 | m_SubKind: 314 | - m_Textures: [] 315 | m_Width: 48 316 | m_Height: 48 317 | m_Kind: 0 318 | m_SubKind: 319 | - m_Textures: [] 320 | m_Width: 36 321 | m_Height: 36 322 | m_Kind: 0 323 | m_SubKind: 324 | - m_Textures: [] 325 | m_Width: 192 326 | m_Height: 192 327 | m_Kind: 1 328 | m_SubKind: 329 | - m_Textures: [] 330 | m_Width: 144 331 | m_Height: 144 332 | m_Kind: 1 333 | m_SubKind: 334 | - m_Textures: [] 335 | m_Width: 96 336 | m_Height: 96 337 | m_Kind: 1 338 | m_SubKind: 339 | - m_Textures: [] 340 | m_Width: 72 341 | m_Height: 72 342 | m_Kind: 1 343 | m_SubKind: 344 | - m_Textures: [] 345 | m_Width: 48 346 | m_Height: 48 347 | m_Kind: 1 348 | m_SubKind: 349 | - m_Textures: [] 350 | m_Width: 36 351 | m_Height: 36 352 | m_Kind: 1 353 | m_SubKind: 354 | m_BuildTargetBatching: 355 | - m_BuildTarget: Standalone 356 | m_StaticBatching: 1 357 | m_DynamicBatching: 0 358 | - m_BuildTarget: tvOS 359 | m_StaticBatching: 1 360 | m_DynamicBatching: 0 361 | - m_BuildTarget: Android 362 | m_StaticBatching: 1 363 | m_DynamicBatching: 0 364 | - m_BuildTarget: iPhone 365 | m_StaticBatching: 1 366 | m_DynamicBatching: 0 367 | - m_BuildTarget: WebGL 368 | m_StaticBatching: 0 369 | m_DynamicBatching: 0 370 | m_BuildTargetGraphicsJobs: 371 | - m_BuildTarget: MacStandaloneSupport 372 | m_GraphicsJobs: 0 373 | - m_BuildTarget: Switch 374 | m_GraphicsJobs: 1 375 | - m_BuildTarget: MetroSupport 376 | m_GraphicsJobs: 1 377 | - m_BuildTarget: GameCoreScarlettSupport 378 | m_GraphicsJobs: 1 379 | - m_BuildTarget: AppleTVSupport 380 | m_GraphicsJobs: 0 381 | - m_BuildTarget: BJMSupport 382 | m_GraphicsJobs: 1 383 | - m_BuildTarget: LinuxStandaloneSupport 384 | m_GraphicsJobs: 1 385 | - m_BuildTarget: GameCoreXboxOneSupport 386 | m_GraphicsJobs: 1 387 | - m_BuildTarget: PS4Player 388 | m_GraphicsJobs: 1 389 | - m_BuildTarget: iOSSupport 390 | m_GraphicsJobs: 0 391 | - m_BuildTarget: PS5Player 392 | m_GraphicsJobs: 1 393 | - m_BuildTarget: WindowsStandaloneSupport 394 | m_GraphicsJobs: 1 395 | - m_BuildTarget: XboxOnePlayer 396 | m_GraphicsJobs: 1 397 | - m_BuildTarget: LuminSupport 398 | m_GraphicsJobs: 0 399 | - m_BuildTarget: CloudRendering 400 | m_GraphicsJobs: 1 401 | - m_BuildTarget: AndroidPlayer 402 | m_GraphicsJobs: 0 403 | - m_BuildTarget: WebGLSupport 404 | m_GraphicsJobs: 0 405 | m_BuildTargetGraphicsJobMode: 406 | - m_BuildTarget: PS4Player 407 | m_GraphicsJobMode: 0 408 | - m_BuildTarget: XboxOnePlayer 409 | m_GraphicsJobMode: 0 410 | m_BuildTargetGraphicsAPIs: 411 | - m_BuildTarget: AndroidPlayer 412 | m_APIs: 15000000 413 | m_Automatic: 1 414 | - m_BuildTarget: iOSSupport 415 | m_APIs: 10000000 416 | m_Automatic: 1 417 | - m_BuildTarget: AppleTVSupport 418 | m_APIs: 10000000 419 | m_Automatic: 1 420 | - m_BuildTarget: WebGLSupport 421 | m_APIs: 0b000000 422 | m_Automatic: 0 423 | - m_BuildTarget: WindowsStandaloneSupport 424 | m_APIs: 02000000 425 | m_Automatic: 0 426 | - m_BuildTarget: MacStandaloneSupport 427 | m_APIs: 10000000 428 | m_Automatic: 0 429 | - m_BuildTarget: LinuxStandaloneSupport 430 | m_APIs: 15000000 431 | m_Automatic: 0 432 | m_BuildTargetVRSettings: 433 | - m_BuildTarget: Standalone 434 | m_Enabled: 0 435 | m_Devices: 436 | - Oculus 437 | - OpenVR 438 | openGLRequireES31: 0 439 | openGLRequireES31AEP: 0 440 | openGLRequireES32: 0 441 | m_TemplateCustomTags: {} 442 | mobileMTRendering: 443 | Android: 1 444 | iPhone: 1 445 | tvOS: 1 446 | m_BuildTargetGroupLightmapEncodingQuality: [] 447 | m_BuildTargetGroupLightmapSettings: [] 448 | m_BuildTargetNormalMapEncoding: [] 449 | playModeTestRunnerEnabled: 0 450 | runPlayModeTestAsEditModeTest: 0 451 | actionOnDotNetUnhandledException: 1 452 | enableInternalProfiler: 0 453 | logObjCUncaughtExceptions: 1 454 | enableCrashReportAPI: 0 455 | cameraUsageDescription: 456 | locationUsageDescription: 457 | microphoneUsageDescription: 458 | switchNMETAOverride: 459 | switchNetLibKey: 460 | switchSocketMemoryPoolSize: 6144 461 | switchSocketAllocatorPoolSize: 128 462 | switchSocketConcurrencyLimit: 14 463 | switchScreenResolutionBehavior: 2 464 | switchUseCPUProfiler: 0 465 | switchUseGOLDLinker: 0 466 | switchApplicationID: 0x01004b9000490000 467 | switchNSODependencies: 468 | switchTitleNames_0: 469 | switchTitleNames_1: 470 | switchTitleNames_2: 471 | switchTitleNames_3: 472 | switchTitleNames_4: 473 | switchTitleNames_5: 474 | switchTitleNames_6: 475 | switchTitleNames_7: 476 | switchTitleNames_8: 477 | switchTitleNames_9: 478 | switchTitleNames_10: 479 | switchTitleNames_11: 480 | switchTitleNames_12: 481 | switchTitleNames_13: 482 | switchTitleNames_14: 483 | switchTitleNames_15: 484 | switchPublisherNames_0: 485 | switchPublisherNames_1: 486 | switchPublisherNames_2: 487 | switchPublisherNames_3: 488 | switchPublisherNames_4: 489 | switchPublisherNames_5: 490 | switchPublisherNames_6: 491 | switchPublisherNames_7: 492 | switchPublisherNames_8: 493 | switchPublisherNames_9: 494 | switchPublisherNames_10: 495 | switchPublisherNames_11: 496 | switchPublisherNames_12: 497 | switchPublisherNames_13: 498 | switchPublisherNames_14: 499 | switchPublisherNames_15: 500 | switchIcons_0: {fileID: 0} 501 | switchIcons_1: {fileID: 0} 502 | switchIcons_2: {fileID: 0} 503 | switchIcons_3: {fileID: 0} 504 | switchIcons_4: {fileID: 0} 505 | switchIcons_5: {fileID: 0} 506 | switchIcons_6: {fileID: 0} 507 | switchIcons_7: {fileID: 0} 508 | switchIcons_8: {fileID: 0} 509 | switchIcons_9: {fileID: 0} 510 | switchIcons_10: {fileID: 0} 511 | switchIcons_11: {fileID: 0} 512 | switchIcons_12: {fileID: 0} 513 | switchIcons_13: {fileID: 0} 514 | switchIcons_14: {fileID: 0} 515 | switchIcons_15: {fileID: 0} 516 | switchSmallIcons_0: {fileID: 0} 517 | switchSmallIcons_1: {fileID: 0} 518 | switchSmallIcons_2: {fileID: 0} 519 | switchSmallIcons_3: {fileID: 0} 520 | switchSmallIcons_4: {fileID: 0} 521 | switchSmallIcons_5: {fileID: 0} 522 | switchSmallIcons_6: {fileID: 0} 523 | switchSmallIcons_7: {fileID: 0} 524 | switchSmallIcons_8: {fileID: 0} 525 | switchSmallIcons_9: {fileID: 0} 526 | switchSmallIcons_10: {fileID: 0} 527 | switchSmallIcons_11: {fileID: 0} 528 | switchSmallIcons_12: {fileID: 0} 529 | switchSmallIcons_13: {fileID: 0} 530 | switchSmallIcons_14: {fileID: 0} 531 | switchSmallIcons_15: {fileID: 0} 532 | switchManualHTML: 533 | switchAccessibleURLs: 534 | switchLegalInformation: 535 | switchMainThreadStackSize: 1048576 536 | switchPresenceGroupId: 537 | switchLogoHandling: 0 538 | switchReleaseVersion: 0 539 | switchDisplayVersion: 1.0.0 540 | switchStartupUserAccount: 0 541 | switchTouchScreenUsage: 0 542 | switchSupportedLanguagesMask: 0 543 | switchLogoType: 0 544 | switchApplicationErrorCodeCategory: 545 | switchUserAccountSaveDataSize: 0 546 | switchUserAccountSaveDataJournalSize: 0 547 | switchApplicationAttribute: 0 548 | switchCardSpecSize: -1 549 | switchCardSpecClock: -1 550 | switchRatingsMask: 0 551 | switchRatingsInt_0: 0 552 | switchRatingsInt_1: 0 553 | switchRatingsInt_2: 0 554 | switchRatingsInt_3: 0 555 | switchRatingsInt_4: 0 556 | switchRatingsInt_5: 0 557 | switchRatingsInt_6: 0 558 | switchRatingsInt_7: 0 559 | switchRatingsInt_8: 0 560 | switchRatingsInt_9: 0 561 | switchRatingsInt_10: 0 562 | switchRatingsInt_11: 0 563 | switchRatingsInt_12: 0 564 | switchLocalCommunicationIds_0: 565 | switchLocalCommunicationIds_1: 566 | switchLocalCommunicationIds_2: 567 | switchLocalCommunicationIds_3: 568 | switchLocalCommunicationIds_4: 569 | switchLocalCommunicationIds_5: 570 | switchLocalCommunicationIds_6: 571 | switchLocalCommunicationIds_7: 572 | switchParentalControl: 0 573 | switchAllowsScreenshot: 1 574 | switchAllowsVideoCapturing: 1 575 | switchAllowsRuntimeAddOnContentInstall: 0 576 | switchDataLossConfirmation: 0 577 | switchUserAccountLockEnabled: 0 578 | switchSystemResourceMemory: 16777216 579 | switchSupportedNpadStyles: 3 580 | switchNativeFsCacheSize: 32 581 | switchIsHoldTypeHorizontal: 0 582 | switchSupportedNpadCount: 8 583 | switchSocketConfigEnabled: 0 584 | switchTcpInitialSendBufferSize: 32 585 | switchTcpInitialReceiveBufferSize: 64 586 | switchTcpAutoSendBufferSizeMax: 256 587 | switchTcpAutoReceiveBufferSizeMax: 256 588 | switchUdpSendBufferSize: 9 589 | switchUdpReceiveBufferSize: 42 590 | switchSocketBufferEfficiency: 4 591 | switchSocketInitializeEnabled: 1 592 | switchNetworkInterfaceManagerInitializeEnabled: 1 593 | switchPlayerConnectionEnabled: 1 594 | switchUseNewStyleFilepaths: 0 595 | switchUseMicroSleepForYield: 1 596 | switchMicroSleepForYieldTime: 25 597 | ps4NPAgeRating: 12 598 | ps4NPTitleSecret: 599 | ps4NPTrophyPackPath: 600 | ps4ParentalLevel: 11 601 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 602 | ps4Category: 0 603 | ps4MasterVersion: 01.00 604 | ps4AppVersion: 01.00 605 | ps4AppType: 0 606 | ps4ParamSfxPath: 607 | ps4VideoOutPixelFormat: 0 608 | ps4VideoOutInitialWidth: 1920 609 | ps4VideoOutBaseModeInitialWidth: 1920 610 | ps4VideoOutReprojectionRate: 60 611 | ps4PronunciationXMLPath: 612 | ps4PronunciationSIGPath: 613 | ps4BackgroundImagePath: 614 | ps4StartupImagePath: 615 | ps4StartupImagesFolder: 616 | ps4IconImagesFolder: 617 | ps4SaveDataImagePath: 618 | ps4SdkOverride: 619 | ps4BGMPath: 620 | ps4ShareFilePath: 621 | ps4ShareOverlayImagePath: 622 | ps4PrivacyGuardImagePath: 623 | ps4ExtraSceSysFile: 624 | ps4NPtitleDatPath: 625 | ps4RemotePlayKeyAssignment: -1 626 | ps4RemotePlayKeyMappingDir: 627 | ps4PlayTogetherPlayerCount: 0 628 | ps4EnterButtonAssignment: 1 629 | ps4ApplicationParam1: 0 630 | ps4ApplicationParam2: 0 631 | ps4ApplicationParam3: 0 632 | ps4ApplicationParam4: 0 633 | ps4DownloadDataSize: 0 634 | ps4GarlicHeapSize: 2048 635 | ps4ProGarlicHeapSize: 2560 636 | playerPrefsMaxSize: 32768 637 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 638 | ps4pnSessions: 1 639 | ps4pnPresence: 1 640 | ps4pnFriends: 1 641 | ps4pnGameCustomData: 1 642 | playerPrefsSupport: 0 643 | enableApplicationExit: 0 644 | resetTempFolder: 1 645 | restrictedAudioUsageRights: 0 646 | ps4UseResolutionFallback: 0 647 | ps4ReprojectionSupport: 0 648 | ps4UseAudio3dBackend: 0 649 | ps4UseLowGarlicFragmentationMode: 1 650 | ps4SocialScreenEnabled: 0 651 | ps4ScriptOptimizationLevel: 0 652 | ps4Audio3dVirtualSpeakerCount: 14 653 | ps4attribCpuUsage: 0 654 | ps4PatchPkgPath: 655 | ps4PatchLatestPkgPath: 656 | ps4PatchChangeinfoPath: 657 | ps4PatchDayOne: 0 658 | ps4attribUserManagement: 0 659 | ps4attribMoveSupport: 0 660 | ps4attrib3DSupport: 0 661 | ps4attribShareSupport: 0 662 | ps4attribExclusiveVR: 0 663 | ps4disableAutoHideSplash: 0 664 | ps4videoRecordingFeaturesUsed: 0 665 | ps4contentSearchFeaturesUsed: 0 666 | ps4CompatibilityPS5: 0 667 | ps4GPU800MHz: 1 668 | ps4attribEyeToEyeDistanceSettingVR: 0 669 | ps4IncludedModules: [] 670 | ps4attribVROutputEnabled: 0 671 | monoEnv: 672 | splashScreenBackgroundSourceLandscape: {fileID: 0} 673 | splashScreenBackgroundSourcePortrait: {fileID: 0} 674 | blurSplashScreenBackground: 1 675 | spritePackerPolicy: 676 | webGLMemorySize: 256 677 | webGLExceptionSupport: 1 678 | webGLNameFilesAsHashes: 0 679 | webGLDataCaching: 0 680 | webGLDebugSymbols: 0 681 | webGLEmscriptenArgs: 682 | webGLModulesDirectory: 683 | webGLTemplate: APPLICATION:Default 684 | webGLAnalyzeBuildSize: 0 685 | webGLUseEmbeddedResources: 0 686 | webGLCompressionFormat: 1 687 | webGLWasmArithmeticExceptions: 0 688 | webGLLinkerTarget: 0 689 | webGLThreadsSupport: 0 690 | webGLDecompressionFallback: 0 691 | scriptingDefineSymbols: {} 692 | additionalCompilerArguments: {} 693 | platformArchitecture: {} 694 | scriptingBackend: 695 | Android: 1 696 | il2cppCompilerConfiguration: {} 697 | managedStrippingLevel: {} 698 | incrementalIl2cppBuild: {} 699 | suppressCommonWarnings: 1 700 | allowUnsafeCode: 0 701 | useDeterministicCompilation: 1 702 | useReferenceAssemblies: 1 703 | enableRoslynAnalyzers: 1 704 | additionalIl2CppArgs: 705 | scriptingRuntimeVersion: 1 706 | gcIncremental: 1 707 | assemblyVersionValidation: 1 708 | gcWBarrierValidation: 0 709 | apiCompatibilityLevelPerPlatform: {} 710 | m_RenderingPath: 1 711 | m_MobileRenderingPath: 1 712 | metroPackageName: Template_3D 713 | metroPackageVersion: 714 | metroCertificatePath: 715 | metroCertificatePassword: 716 | metroCertificateSubject: 717 | metroCertificateIssuer: 718 | metroCertificateNotAfter: 0000000000000000 719 | metroApplicationDescription: Template_3D 720 | wsaImages: {} 721 | metroTileShortName: 722 | metroTileShowName: 0 723 | metroMediumTileShowName: 0 724 | metroLargeTileShowName: 0 725 | metroWideTileShowName: 0 726 | metroSupportStreamingInstall: 0 727 | metroLastRequiredScene: 0 728 | metroDefaultTileSize: 1 729 | metroTileForegroundText: 2 730 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 731 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 732 | a: 1} 733 | metroSplashScreenUseBackgroundColor: 0 734 | platformCapabilities: {} 735 | metroTargetDeviceFamilies: {} 736 | metroFTAName: 737 | metroFTAFileTypes: [] 738 | metroProtocolName: 739 | XboxOneProductId: 740 | XboxOneUpdateKey: 741 | XboxOneSandboxId: 742 | XboxOneContentId: 743 | XboxOneTitleId: 744 | XboxOneSCId: 745 | XboxOneGameOsOverridePath: 746 | XboxOnePackagingOverridePath: 747 | XboxOneAppManifestOverridePath: 748 | XboxOneVersion: 1.0.0.0 749 | XboxOnePackageEncryption: 0 750 | XboxOnePackageUpdateGranularity: 2 751 | XboxOneDescription: 752 | XboxOneLanguage: 753 | - enus 754 | XboxOneCapability: [] 755 | XboxOneGameRating: {} 756 | XboxOneIsContentPackage: 0 757 | XboxOneEnhancedXboxCompatibilityMode: 0 758 | XboxOneEnableGPUVariability: 0 759 | XboxOneSockets: {} 760 | XboxOneSplashScreen: {fileID: 0} 761 | XboxOneAllowedProductIds: [] 762 | XboxOnePersistentLocalStorageSize: 0 763 | XboxOneXTitleMemory: 8 764 | XboxOneOverrideIdentityName: 765 | XboxOneOverrideIdentityPublisher: 766 | vrEditorSettings: {} 767 | cloudServicesEnabled: 768 | UNet: 1 769 | luminIcon: 770 | m_Name: 771 | m_ModelFolderPath: 772 | m_PortalFolderPath: 773 | luminCert: 774 | m_CertPath: 775 | m_SignPackage: 1 776 | luminIsChannelApp: 0 777 | luminVersion: 778 | m_VersionCode: 1 779 | m_VersionName: 780 | apiCompatibilityLevel: 6 781 | activeInputHandler: 0 782 | cloudProjectId: 783 | framebufferDepthMemorylessMode: 0 784 | qualitySettingsNames: [] 785 | projectName: Template_3D 786 | organizationId: 787 | cloudEnabled: 0 788 | legacyClampBlendShapeWeights: 1 789 | virtualTexturingSupportEnabled: 0 790 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.11f1 2 | m_EditorVersionWithRevision: 2020.3.11f1 (99c7afb366b3) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: High 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 1 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 40 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 1 21 | blendWeights: 2 22 | textureQuality: 0 23 | anisotropicTextures: 1 24 | antiAliasing: 2 25 | softParticles: 0 26 | softVegetation: 1 27 | realtimeReflectionProbes: 1 28 | billboardsFaceCameraPosition: 1 29 | vSyncCount: 1 30 | lodBias: 1 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 256 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | m_PerPlatformDefaultQuality: 38 | Android: 0 39 | Nintendo 3DS: 0 40 | Nintendo Switch: 0 41 | PS4: 0 42 | PSP2: 0 43 | Standalone: 0 44 | Tizen: 0 45 | WebGL: 0 46 | WiiU: 0 47 | Windows Store Apps: 0 48 | XboxOne: 0 49 | iPhone: 0 50 | tvOS: 0 51 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.0167 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 60 16 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TextureUpdateExample 2 | ==================== 3 | 4 | ![gif](https://i.imgur.com/VqHhCcx.gif) 5 | 6 | *Old-school plasma effect generated by C++ code* 7 | 8 | This is an example that shows how to use the [CustomTextureUpdate] callback 9 | that allows native plugins to update contents of textures in a thread safe and 10 | platform agnostic way. 11 | 12 | [CustomTextureUpdate]: 13 | https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.IssuePluginCustomTextureUpdateV2.html 14 | 15 | How to implement the CustomTextureUpdate callback 16 | ------------------------------------------------- 17 | 18 | The callback function should be implemented with the following signature: 19 | 20 | ```c 21 | void TextureUpdateCallback(int eventID, void *data) 22 | { 23 | UnityRenderingExtTextureUpdateParamsV2 *params = data; 24 | } 25 | ``` 26 | 27 | The type of the event will be given to `eventID`, and the attributes of the 28 | target texture will be given with `UnityRenderingExtTextureUpdateParamsV2` 29 | struct carried by the `data` pointer. 30 | 31 | The possible values of `eventID` are defined in `UnityRenderingExtEventType`; 32 | Only `kUnityRenderingExtEventUpdateTextureBeginV2` and 33 | `kUnityRenderingExtEventUpdateTextureEndV2` are relevant to the texture update 34 | callback. 35 | 36 | ### `kUnityRenderingExtEventUpdateTextureBeginV2` event 37 | 38 | This event is invoked right before updating the texture. You can give raw image 39 | data via the `texData` pointer in the parameter struct. 40 | 41 | ```c 42 | if (eventID == kUnityRenderingExtEventUpdateTextureBeginV2) 43 | { 44 | uint8_t *img = malloc(params->width * params->height * 4); 45 | 46 | // Fill image data here. 47 | 48 | params->texData = img; 49 | } 50 | ``` 51 | 52 | You can also give `nullptr` to `texData` when you don't like to update the 53 | texture in this frame. 54 | 55 | ### `kUnityRenderingExtEventUpdateTextureEndV2` event 56 | 57 | This event is invoked right after updating the texture. You can safely release 58 | resources used to update the texture. 59 | 60 | ```c 61 | if (event == kUnityRenderingExtEventUpdateTextureEndV2) 62 | { 63 | free(params->texData); 64 | } 65 | ``` 66 | 67 | ### Interface function 68 | 69 | You have to implement an interface function that is used to retrieve the 70 | pointer of the callback function. 71 | 72 | ```c 73 | UnityRenderingEventAndData UNITY_INTERFACE_EXPORT GetTextureUpdateCallback() 74 | { 75 | return TextureUpdateCallback; 76 | } 77 | ``` 78 | 79 | For further details of the plugin implementation, please see the 80 | [example source code](https://github.com/keijiro/TextureUpdateExample/blob/master/Plugin/Plasma.c) 81 | contained in this repository. 82 | 83 | How to update texture from C# script 84 | ------------------------------------ 85 | 86 | In order to request texture update from a C# script, you can use 87 | `IssuePluginCustomTextureUpdateV2` with a `CommandBuffer`. The pointer to the 88 | callback function and a reference to a texture object should be given to the 89 | command. You can also give a single `uint` value to the command that can be 90 | used as user data to the callback. 91 | 92 | ```csharp 93 | [DllImport("DllName")] static extern IntPtr GetTextureUpdateCallback(); 94 | 95 | var callback = GetTextureUpdateCallback(); 96 | m_CommandBuffer.IssuePluginCustomTextureUpdateV2(callback, texture, userData); 97 | Graphics.ExecuteCommandBuffer(m_CommandBuffer); 98 | ``` 99 | --------------------------------------------------------------------------------