Skip to content

Commit

Permalink
Remove android-specific ARB code. ARB should work in 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
pema99 committed Dec 9, 2023
1 parent 72c4059 commit a680df4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 119 deletions.
50 changes: 4 additions & 46 deletions Packages/com.llealloo.audiolink/Runtime/AudioLink.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
58 changes: 11 additions & 47 deletions Packages/com.llealloo.audiolink/Runtime/AudioLinkAvatar.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -66,6 +68,7 @@ VideoPlayer:
m_Looping: 1
m_WaitForFirstFrame: 1
m_FrameReadyEventEnabled: 0
m_VideoShaders: []
--- !u!114 &967283404053619123
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ 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
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ 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
m_SRGB: 1
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
Expand All @@ -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}
Expand Down
24 changes: 2 additions & 22 deletions Packages/com.llealloo.audiolink/Runtime/Scripts/AudioLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Camera>());
#endif
#if UDONSHARP
{
// Handle sync'd time stuff.
Expand Down Expand Up @@ -437,7 +433,6 @@ private void Update()
return;
}

#if !UNITY_ANDROID
if (audioDataToggle)
{
#if UDONSHARP
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -760,17 +746,11 @@ public void DisableAudioLink()
public void EnableReadback()
{
audioDataToggle = true;
#if UNITY_ANDROID
GetComponent<Camera>().enabled = true;
#endif
}

public void DisableReadback()
{
audioDataToggle = false;
#if UNITY_ANDROID
GetComponent<Camera>().enabled = false;
#endif
}

public void SendAudioOutputData()
Expand Down

0 comments on commit a680df4

Please sign in to comment.