Workaround on iOS to enable SSAO without affecting blur shader on startup

This commit is contained in:
Jiaqi Liu committed 2023-04-01 02:35:54 -07:00
1 parent 188056e260
commit cfcf7fd493
3 files changed
+17 -1

No files matched your search

@@ -104,7 +104,7 @@ Shader "Pal3/RoundedFrostedGlass"
float4 _MultiplyColor;
float4 _WidthHeightRadius;
half4 frag( v2f i ) : COLOR
half4 frag(v2f i) : COLOR
{
const float alpha = CalcAlpha(i.uvmain, _WidthHeightRadius.xy, _WidthHeightRadius.z);
half4 cutoffColor = mixAlpha(tex2D(_MainTex, i.uvmain), _AdditiveColor, alpha);
@@ -6,6 +6,7 @@
namespace Pal3.Effect.PostProcessing
{
using System;
using System.Collections;
using Command;
using Command.InternalCommands;
using Command.SceCommands;
@@ -60,6 +61,21 @@ namespace Pal3.Effect.PostProcessing
TogglePostProcessLayerWhenNeeded();
}
#if UNITY_IOS
// On iOS, the SSAO is causing the RoundedFrostedGlass shader to malfunction.
// This is a workaround to disable and re-enable SSAO to fix the issue.
private IEnumerator Start()
{
if (_gameSettings.IsAmbientOcclusionEnabled)
{
yield return null;
_gameSettings.IsAmbientOcclusionEnabled = false;
yield return null;
_gameSettings.IsAmbientOcclusionEnabled = true;
}
}
#endif
private void ToggleBloomBasedOnSetting()
{
if (_gameSettings.IsRealtimeLightingAndShadowsEnabled)