From a680df4024d81bd6761e31d7f777e22b24dedaf1 Mon Sep 17 00:00:00 2001 From: Pema Malling Date: Sat, 9 Dec 2023 16:30:48 +0100 Subject: [PATCH] Remove android-specific ARB code. ARB should work in 2022 --- .../Runtime/AudioLink.prefab | 50 ++-------------- .../Runtime/AudioLinkAvatar.prefab | 58 ++++--------------- .../Runtime/RenderTextures/rt_AudioLink.asset | 7 ++- .../RenderTextures/rt_MiniPlayer.asset | 7 ++- .../Runtime/Scripts/AudioLink.cs | 24 +------- 5 files changed, 27 insertions(+), 119 deletions(-) diff --git a/Packages/com.llealloo.audiolink/Runtime/AudioLink.prefab b/Packages/com.llealloo.audiolink/Runtime/AudioLink.prefab index ffe22f72..e80cff37 100644 --- a/Packages/com.llealloo.audiolink/Runtime/AudioLink.prefab +++ b/Packages/com.llealloo.audiolink/Runtime/AudioLink.prefab @@ -11,7 +11,6 @@ GameObject: - component: {fileID: 4559840160047443413} - component: {fileID: 2439678698260312388} - component: {fileID: 8295703945185298429} - - component: {fileID: -8008548045606811714} m_Layer: 0 m_Name: AudioLink m_TagString: Untagged @@ -26,13 +25,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 939041022165984647} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 73795, y: 99824, z: 92375} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 849179696126897609} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2439678698260312388 MonoBehaviour: @@ -111,49 +111,6 @@ MonoBehaviour: publicVariablesUnityEngineObjects: - {fileID: 2100000, guid: 5189d837989b9144e8e43d3ce618e450, type: 2} publicVariablesSerializationDataFormat: 0 ---- !u!20 &-8008548045606811714 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 939041022165984647} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 4 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: -10 - far clip plane: 10 - field of view: 60 - orthographic: 1 - orthographic size: 10 - m_Depth: -99 - m_CullingMask: - serializedVersion: 2 - m_Bits: 1 - m_RenderingPath: 0 - m_TargetTexture: {fileID: 8600000, guid: f51fa799ef0abde489235f40fc0328ef, type: 2} - m_TargetDisplay: 0 - m_TargetEye: 0 - m_HDR: 1 - m_AllowMSAA: 0 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 0 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 --- !u!1 &5250813097568517944 GameObject: m_ObjectHideFlags: 0 @@ -179,12 +136,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5250813097568517944} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4559840160047443413} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!82 &569928628364396331 AudioSource: diff --git a/Packages/com.llealloo.audiolink/Runtime/AudioLinkAvatar.prefab b/Packages/com.llealloo.audiolink/Runtime/AudioLinkAvatar.prefab index 73fae370..b4250dab 100644 --- a/Packages/com.llealloo.audiolink/Runtime/AudioLinkAvatar.prefab +++ b/Packages/com.llealloo.audiolink/Runtime/AudioLinkAvatar.prefab @@ -25,12 +25,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2855380161400777556} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8800328339556915023} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!328 &5208934818770322006 VideoPlayer: @@ -51,6 +52,7 @@ VideoPlayer: m_RenderMode: 4 m_AspectRatio: 2 m_DataSource: 1 + m_TimeUpdateMode: 2 m_PlaybackSpeed: 1 m_AudioOutputMode: 1 m_TargetAudioSources: @@ -66,6 +68,7 @@ VideoPlayer: m_Looping: 1 m_WaitForFirstFrame: 1 m_FrameReadyEventEnabled: 0 + m_VideoShaders: [] --- !u!114 &967283404053619123 MonoBehaviour: m_ObjectHideFlags: 0 @@ -92,7 +95,6 @@ GameObject: m_Component: - component: {fileID: 8800328339556915023} - component: {fileID: 114898744479896330} - - component: {fileID: 8800328339556915022} m_Layer: 0 m_Name: AudioLinkAvatar m_TagString: Untagged @@ -107,14 +109,15 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8800328339556915021} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 73795, y: 99824, z: 92375} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 8800328340110197118} - {fileID: 3116662414120361943} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114898744479896330 MonoBehaviour: @@ -142,6 +145,8 @@ MonoBehaviour: threshold3: 0.45 fadeLength: 0.8 fadeExpFalloff: 0.3 + autogain: 1 + autogainDerate: 0.1 themeColorMode: 0 customThemeColor0: {r: 0, g: 0.7176471, b: 1, a: 1} customThemeColor1: {r: 0.5137255, g: 0.2627451, b: 1, a: 1} @@ -151,51 +156,9 @@ MonoBehaviour: customString2: audioMaterial: {fileID: 2100000, guid: 5189d837989b9144e8e43d3ce618e450, type: 2} audioRenderTexture: {fileID: 8600000, guid: f51fa799ef0abde489235f40fc0328ef, type: 2} + autoSetMediaState: 1 audioDataToggle: 0 audioData2D: {fileID: 2800000, guid: b07c8466531ac5e4e852f3e276e4baca, type: 2} ---- !u!20 &8800328339556915022 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8800328339556915021} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 4 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: -10 - far clip plane: 10 - field of view: 60 - orthographic: 1 - orthographic size: 10 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 1 - m_RenderingPath: 0 - m_TargetTexture: {fileID: 8600000, guid: f51fa799ef0abde489235f40fc0328ef, type: 2} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 0 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 0 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 --- !u!1 &8800328340110197117 GameObject: m_ObjectHideFlags: 0 @@ -220,12 +183,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8800328340110197117} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8800328339556915023} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!82 &8800328340110197116 AudioSource: diff --git a/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_AudioLink.asset b/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_AudioLink.asset index 5edfe8a5..1f9c2815 100644 --- a/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_AudioLink.asset +++ b/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_AudioLink.asset @@ -12,12 +12,13 @@ CustomRenderTexture: Hash: 00000000000000000000000000000000 m_ForcedFallbackFormat: 4 m_DownscaleFallback: 0 - serializedVersion: 3 + m_IsAlphaChannelOptional: 0 + serializedVersion: 5 m_Width: 128 m_Height: 64 m_AntiAliasing: 1 m_MipCount: -1 - m_DepthFormat: 0 + m_DepthStencilFormat: 0 m_ColorFormat: 52 m_MipMap: 0 m_GenerateMips: 1 @@ -25,6 +26,7 @@ CustomRenderTexture: m_UseDynamicScale: 0 m_BindMS: 0 m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 m_TextureSettings: serializedVersion: 2 m_FilterMode: 0 @@ -35,6 +37,7 @@ CustomRenderTexture: m_WrapW: 1 m_Dimension: 2 m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 m_Material: {fileID: 2100000, guid: 5189d837989b9144e8e43d3ce618e450, type: 2} m_InitSource: 0 m_InitMaterial: {fileID: 0} diff --git a/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_MiniPlayer.asset b/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_MiniPlayer.asset index 97686c56..a0871aa6 100644 --- a/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_MiniPlayer.asset +++ b/Packages/com.llealloo.audiolink/Runtime/RenderTextures/rt_MiniPlayer.asset @@ -12,12 +12,13 @@ CustomRenderTexture: Hash: 00000000000000000000000000000000 m_ForcedFallbackFormat: 4 m_DownscaleFallback: 0 - serializedVersion: 3 + m_IsAlphaChannelOptional: 0 + serializedVersion: 5 m_Width: 1280 m_Height: 720 m_AntiAliasing: 1 m_MipCount: -1 - m_DepthFormat: 0 + m_DepthStencilFormat: 0 m_ColorFormat: 4 m_MipMap: 0 m_GenerateMips: 1 @@ -25,6 +26,7 @@ CustomRenderTexture: m_UseDynamicScale: 0 m_BindMS: 0 m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 m_TextureSettings: serializedVersion: 2 m_FilterMode: 1 @@ -35,6 +37,7 @@ CustomRenderTexture: m_WrapW: 1 m_Dimension: 2 m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 m_Material: {fileID: 2100000, guid: ae1e47fbab3b44c40a3d09c599e57f3d, type: 2} m_InitSource: 0 m_InitMaterial: {fileID: 0} diff --git a/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLink.cs b/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLink.cs index 2d0f5330..98251af1 100644 --- a/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLink.cs +++ b/Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLink.cs @@ -277,10 +277,6 @@ private void InitIDs() // TODO(3): try to port this to standalone void Start() { -#if !UNITY_ANDROID - // remove camera if we aren't on quest - Destroy(GetComponent()); -#endif #if UDONSHARP { // Handle sync'd time stuff. @@ -437,7 +433,6 @@ private void Update() return; } -#if !UNITY_ANDROID if (audioDataToggle) { #if UDONSHARP @@ -446,7 +441,6 @@ private void Update() AsyncGPUReadback.Request(audioRenderTexture, 0, TextureFormat.RGBAFloat, OnAsyncGpuReadbackComplete); #endif } -#endif // Tested: There does not appear to be any drift updating it this way. _elapsedTime += Time.deltaTime; @@ -563,16 +557,8 @@ private void Update() UpdateCustomStrings(); #endif } -#if UNITY_ANDROID - void OnPostRender() - { - if (_audioLinkEnabled && audioDataToggle) - { - audioData2D.ReadPixels(new Rect(0, 0, audioData2D.width, audioData2D.height), 0, 0, false); - audioData = audioData2D.GetPixels(); - } - } -#elif UDONSHARP + +#if UDONSHARP public override void OnAsyncGpuReadbackComplete(VRCAsyncGPUReadbackRequest request) { if (request.hasError || !request.done) return; @@ -760,17 +746,11 @@ public void DisableAudioLink() public void EnableReadback() { audioDataToggle = true; -#if UNITY_ANDROID - GetComponent().enabled = true; -#endif } public void DisableReadback() { audioDataToggle = false; -#if UNITY_ANDROID - GetComponent().enabled = false; -#endif } public void SendAudioOutputData()