From fbcaecf5966022219b00164ddadd3a5500411765 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 25 Jun 2025 18:57:10 +0800 Subject: [PATCH] =?UTF-8?q?remove=20shader=20RLPro=20=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E4=B8=8D=E7=90=86=E6=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manager/AppSettings/Filter/RLPro.meta | 8 - .../AppSettings/Filter/RLPro/RLPRO_CRT.cs | 162 ---------------- .../Filter/RLPro/RLPRO_CRT.cs.meta | 2 - .../Filter/RLPro/RLPro_Bleed.shader | 175 ------------------ .../Filter/RLPro/RLPro_Bleed.shader.meta | 9 - .../Filter/RLPro/RLPro_CRT_Aperture.shader | 144 -------------- .../RLPro/RLPro_CRT_Aperture.shader.meta | 9 - .../Filter/RLPro/RLPro_TV_Effect.shader | 162 ---------------- .../Filter/RLPro/RLPro_TV_Effect.shader.meta | 9 - 9 files changed, 680 deletions(-) delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro.meta delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs.meta delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader.meta delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader.meta delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader delete mode 100644 AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader.meta diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro.meta deleted file mode 100644 index fa0c2c14..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b5c1ebe19e88e8840b17582b45643281 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs deleted file mode 100644 index ca28ecdc..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs +++ /dev/null @@ -1,162 +0,0 @@ -using Assets.Script.AppMain.Filter; -using UnityEngine; - -namespace AxibugEmuOnline.Client.Filters -{ - [Strip(RuntimePlatform.PSP2)] - public class RLPRO_CRT : FilterEffect - { - public override string Name => nameof(RLPRO_CRT); - protected override string ShaderName => null; - - #region BleedPass_Param - public FilterParameter BleedMode = EnumBleedMode.NTSCOld3Phase; - [Range(0, 15)] - public FloatParameter BleedAmount = 1f; - #endregion - #region CRTAperture_Param - [Range(0, 5)] - public FloatParameter GlowHalation = 0.1f; - [Range(0, 2)] - public FloatParameter GlowDifusion = 0.05f; - [Range(0, 2)] - public FloatParameter MaskColors = 2.0f; - [Range(0, 1)] - public FloatParameter MaskStrength = 0.3f; - [Range(0, 5)] - public FloatParameter GammaInput = 2.4f; - [Range(0, 5)] - public FloatParameter GammaOutput = 2.4f; - [Range(0, 2.5f)] - public FloatParameter Brightness = 1.5f; - #endregion - #region TV_Effect_Param - public FilterParameter WrapMode = EnumWrapMode.SimpleWrap; - [Range(0f, 2f)] - public FloatParameter maskDark = 0.5f; - [Range(0f, 2f)] - public FloatParameter maskLight = 1.5f; - [Range(-8f, -16f)] - public FloatParameter hardScan = -8.0f; - [Range(-3f, 1f)] - public FloatParameter hardPix = -3.0f; - public FloatParameter warpX = 0.03125f; - public FloatParameter warpY = 0.04166f; - [Range(1f, 16f)] - public FloatParameter resScale = 4f; - [Range(0.5f, 5f)] - public FloatParameter scale = 1f; - [Range(0f, 1f)] - public FloatParameter fade = 1f; - #endregion - - Material m_bleedMat; - Material m_crtApertureMat; - Material m_tvEffectMat; - - protected override void OnInit(Material renderMat) - { - m_bleedMat = new Material(Shader.Find("Filter/RLPro_Bleed")); - m_crtApertureMat = new Material(Shader.Find("Filter/RLPro_CRT_Aperture")); - m_tvEffectMat = new Material(Shader.Find("Filter/RLPro_TV_Effect")); - } - - protected override void OnRenderer(Material renderMat, Texture src, RenderTexture result) - { - var rt1 = BleedPass(src); - var rt2 = CRT_AperturePass(rt1); - var rt3 = TV_Effect_Pass(rt2); - - Graphics.Blit(rt3, result); - - RenderTexture.ReleaseTemporary(rt1); - RenderTexture.ReleaseTemporary(rt2); - RenderTexture.ReleaseTemporary(rt3); - } - - private RenderTexture BleedPass(Texture src) - { - var rt = RenderTexture.GetTemporary(src.width, src.height); - - m_bleedMat.DisableKeyword("_NTSCOld3Phase"); - m_bleedMat.DisableKeyword("_NTSC3Phase"); - m_bleedMat.DisableKeyword("_NTSC2Phase"); - - switch (BleedMode.GetValue()) - { - case EnumBleedMode.NTSCOld3Phase: - m_bleedMat.EnableKeyword("_NTSCOld3Phase"); - break; - case EnumBleedMode.NTSC3Phase: - m_bleedMat.EnableKeyword("_NTSC3Phase"); - break; - case EnumBleedMode.NTSC2Phase: - m_bleedMat.EnableKeyword("_NTSC2Phase"); - break; - } - - m_bleedMat.SetFloat("bleedAmount", BleedAmount.GetValue()); - - Graphics.Blit(src, rt, m_bleedMat); - - return rt; - } - private RenderTexture CRT_AperturePass(Texture src) - { - var rt = RenderTexture.GetTemporary(src.width, src.height); - - m_crtApertureMat.SetFloat("GLOW_HALATION", GlowHalation.GetValue()); - m_crtApertureMat.SetFloat("GLOW_DIFFUSION", GlowDifusion.GetValue()); - m_crtApertureMat.SetFloat("MASK_COLORS", MaskColors.GetValue()); - m_crtApertureMat.SetFloat("MASK_STRENGTH", MaskStrength.GetValue()); - m_crtApertureMat.SetFloat("GAMMA_INPUT", GammaInput.GetValue()); - m_crtApertureMat.SetFloat("GAMMA_OUTPUT", GammaOutput.GetValue()); - m_crtApertureMat.SetFloat("BRIGHTNESS", Brightness.GetValue()); - - Graphics.Blit(src, rt, m_crtApertureMat); - - return rt; - } - private RenderTexture TV_Effect_Pass(Texture src) - { - var rt = RenderTexture.GetTemporary(src.width, src.height); - - m_tvEffectMat.DisableKeyword("_SimpleWrap"); - m_tvEffectMat.DisableKeyword("_CubicDistortion"); - - switch (WrapMode.GetValue()) - { - case EnumWrapMode.SimpleWrap: - m_tvEffectMat.EnableKeyword("_SimpleWrap"); break; - case EnumWrapMode.CubicDistortion: - m_tvEffectMat.EnableKeyword("_CubicDistortion"); break; - } - - m_tvEffectMat.SetFloat("maskDark", maskDark); - m_tvEffectMat.SetFloat("maskLight", maskLight); - m_tvEffectMat.SetFloat("hardScan", hardScan); - m_tvEffectMat.SetFloat("hardPix", hardPix); - m_tvEffectMat.SetVector("warp", new Vector4(warpX, warpY)); - m_tvEffectMat.SetFloat("resScale", resScale); - m_tvEffectMat.SetFloat("scale", scale); - m_tvEffectMat.SetFloat("fade", fade); - - Graphics.Blit(src, rt, m_tvEffectMat); - - return rt; - } - - public enum EnumBleedMode - { - NTSCOld3Phase, - NTSC3Phase, - NTSC2Phase, - } - - public enum EnumWrapMode - { - SimpleWrap, - CubicDistortion - } - } -} \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs.meta deleted file mode 100644 index 1d65124b..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: fcc83c5bfa946f748811247794560a56 \ No newline at end of file diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader deleted file mode 100644 index 4840f8e4..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader +++ /dev/null @@ -1,175 +0,0 @@ -Shader "Filter/RLPro_Bleed" -{ - Properties - { - _MainTex ("Base (RGB)", 2D) = "white" {} - } - SubShader - { - Pass - { - CGPROGRAM - - #pragma shader_feature_local _NTSCOld3Phase _NTSC3Phase _NTSC2Phase - #pragma vertex vert_img - #pragma fragment frag - #include "UnityCG.cginc" - - sampler2D _MainTex; - float4 _MainTex_TexelSize; - float2 _iResolution; - - float bleedAmount = 1.0; - int bleedLength = 21; - - struct v2f - { - float4 pos : POSITION; - float2 uv : TEXCOORD0; - }; - - half3 rgb2yiq(half3 c) - { - return half3( - (0.2989 * c.x + 0.5959 * c.y + 0.2115 * c.z), - (0.5870 * c.x - 0.2744 * c.y - 0.5229 * c.z), - (0.1140 * c.x - 0.3216 * c.y + 0.3114 * c.z) - ); - } - - half3 yiq2rgb(half3 c) - { - return half3( - (1.0 * c.x + 1.0 * c.y + 1.0 * c.z), - (0.956 * c.x - 0.2720 * c.y - 1.1060 * c.z), - (0.6210 * c.x - 0.6474 * c.y + 1.7046 * c.z) - ); - } - - half3 t2d(float2 p) - { - half3 col = tex2D(_MainTex, p).rgb; - - return rgb2yiq(col); - } - - #define fixCoord (p - float2( 0.5 * ONE_X, 0.0)) - #define fetch_offset(offset, one_x) t2d(fixCoord + float2( (offset) * (ONE_X), 0.0)); - #define get_t2d(offset, one_x) tex2D(_MainTex, p + (offset)*(one_x)).rgb; - - float4 FragNTSCOld3Phase(v2f i) : COLOR - { - float2 uv = i.uv; - float2 p = uv; - float ONE_X = 1.0 / _ScreenParams.x; - - ONE_X *= bleedAmount; - bleedLength = 25; - float maxTexLength = 50.0; - float luma_filter[25]; luma_filter[0] = -0.000071070; luma_filter[1] = -0.000032816; luma_filter[2] = 0.000128784; luma_filter[3] = 0.000134711; luma_filter[4] = -0.000226705; luma_filter[5] = -0.000777988; luma_filter[6] = -0.000997809; luma_filter[7] = -0.000522802; luma_filter[8] = 0.000344691; luma_filter[9] = 0.000768930; luma_filter[10] = 0.000275591; luma_filter[11] = -0.000373434; luma_filter[12] = 0.000522796; luma_filter[13] = 0.003813817; luma_filter[14] = 0.007502825; luma_filter[15] = 0.006786001; luma_filter[16] = -0.002636726; luma_filter[17] = -0.019461182; luma_filter[18] = -0.033792479; luma_filter[19] = -0.029921972; luma_filter[20] = 0.005032552; luma_filter[21] = 0.071226466; luma_filter[22] = 0.151755921; luma_filter[23] = 0.218166470; luma_filter[24] = 0.243902439; - float chroma_filter[24 + 1]; chroma_filter[0] = 0.001845562; chroma_filter[1] = 0.002381606; chroma_filter[2] = 0.003040177; chroma_filter[3] = 0.003838976; chroma_filter[4] = 0.004795341; chroma_filter[5] = 0.005925312; chroma_filter[6] = 0.007242534; chroma_filter[7] = 0.008757043; chroma_filter[8] = 0.010473987; chroma_filter[9] = 0.012392365; chroma_filter[10] = 0.014503872; chroma_filter[11] = 0.016791957; chroma_filter[12] = 0.019231195; chroma_filter[13] = 0.021787070; chroma_filter[14] = 0.024416251; chroma_filter[15] = 0.027067414; chroma_filter[16] = 0.029682613; chroma_filter[17] = 0.032199202; chroma_filter[18] = 0.034552198; chroma_filter[19] = 0.036677005; chroma_filter[20] = 0.038512317; chroma_filter[21] = 0.040003044; chroma_filter[22] = 0.041103048; chroma_filter[23] = 0.041777517; chroma_filter[24] = 0.042004791; - half3 signal = half3(0.0,0.0,0.0); - half3 norm = half3(0.0,0.0,0.0); - half3 adj = half3(0.0,0.0,0.0); - int taps = bleedLength - 4; - for (int ii = 0; ii < taps % 1023; ii++) - { - float offset = float(ii); - half3 sums = fetch_offset(offset - float(taps), ONE_X) + fetch_offset(float(taps) - offset, ONE_X); - adj = half3(luma_filter[ii + 3], chroma_filter[ii], chroma_filter[ii]); - signal += sums * adj; - norm += adj; - } - adj = half3(luma_filter[taps], chroma_filter[taps], chroma_filter[taps]); - half4 col23 = tex2D(_MainTex, fixCoord); - signal += rgb2yiq(col23.rgb) * adj; - norm += adj; - signal = signal / norm; - float3 rgb = yiq2rgb(signal); - - float alpha = col23.a + (rgb.r + rgb.g + rgb.b) / 3; - return half4(rgb, alpha); - } - - float4 FragNTSC3Phase(v2f i) : COLOR - { - float2 uv = i.uv; - float2 p = uv; - float ONE_X = 1.0 / _iResolution.x; - - ONE_X *= bleedAmount; - bleedLength = 25; - float maxTexLength = 50.0; - float luma_filter[25]; luma_filter[0] = -0.000012020; luma_filter[1] = -0.000022146; luma_filter[2] = -0.000013155; luma_filter[3] = -0.000012020; luma_filter[4] = -0.000049979; luma_filter[5] = -0.000113940; luma_filter[6] = -0.000122150; luma_filter[7] = -0.000005612; luma_filter[8] = 0.000170516; luma_filter[9] = 0.000237199; luma_filter[10] = 0.000169640; luma_filter[11] = 0.000285688; luma_filter[12] = 0.000984574; luma_filter[13] = 0.002018683; luma_filter[14] = 0.002002275; luma_filter[15] = -0.000909882; luma_filter[16] = -0.007049081; luma_filter[17] = -0.013222860; luma_filter[18] = -0.012606931; luma_filter[19] = 0.002460860; luma_filter[20] = 0.035868225; luma_filter[21] = 0.084016453; luma_filter[22] = 0.135563500; luma_filter[23] = 0.175261268; luma_filter[24] = 0.190176552; - float chroma_filter[25]; chroma_filter[0] = -0.000118847; chroma_filter[1] = -0.000271306; chroma_filter[2] = -0.000502642; chroma_filter[3] = -0.000930833; chroma_filter[4] = -0.001451013; chroma_filter[5] = -0.002064744; chroma_filter[6] = -0.002700432; chroma_filter[7] = -0.003241276; chroma_filter[8] = -0.003524948; chroma_filter[9] = -0.003350284; chroma_filter[10] = -0.002491729; chroma_filter[11] = -0.000721149; chroma_filter[12] = 0.002164659; chroma_filter[13] = 0.006313635; chroma_filter[14] = 0.011789103; chroma_filter[15] = 0.018545660; chroma_filter[16] = 0.026414396; chroma_filter[17] = 0.035100710; chroma_filter[18] = 0.044196567; chroma_filter[19] = 0.053207202; chroma_filter[20] = 0.061590275; chroma_filter[21] = 0.068803602; chroma_filter[22] = 0.074356193; chroma_filter[23] = 0.077856564; chroma_filter[24] = 0.079052396; - half3 signal = half3(0.0,0.0,0.0); - half3 norm = half3(0.0,0.0,0.0); - half3 adj = half3(0.0,0.0,0.0); - int taps = bleedLength - 4; - for (int ii = 0; ii < taps % 1023; ii++) - { - float offset = float(ii); - half3 sums = fetch_offset(offset - float(taps), ONE_X) + fetch_offset(float(taps) - offset, ONE_X); - adj = half3(luma_filter[ii + 3], chroma_filter[ii], chroma_filter[ii]); - signal += sums * adj; - norm += adj; - } - adj = half3(luma_filter[taps], chroma_filter[taps], chroma_filter[taps]); - half4 col23 = tex2D(_MainTex, fixCoord); - signal += rgb2yiq(col23.rgb) * adj; - norm += adj; - signal = signal / norm; - float3 rgb = yiq2rgb(signal); - - float alpha = col23.a + (rgb.r + rgb.g + rgb.b) / 3; - return half4(rgb, alpha); - } - - float4 FragNTSC2Phase(v2f i) : COLOR - { - float2 uv = i.uv; - float2 p = uv; - float ONE_X = 1.0 / _ScreenParams.x; - - ONE_X *= bleedAmount; - bleedLength = 33; - float maxTexLength = 50.0; - float luma_filter[33]; luma_filter[0] = -0.000174844; luma_filter[1] = -0.000205844; luma_filter[2] = -0.000149453; luma_filter[3] = -0.000051693; luma_filter[4] = 0.000000000; luma_filter[5] = -0.000066171; luma_filter[6] = -0.000245058; luma_filter[7] = -0.000432928; luma_filter[8] = -0.000472644; luma_filter[9] = -0.000252236; luma_filter[10] = 0.000198929; luma_filter[11] = 0.000687058; luma_filter[12] = 0.000944112; luma_filter[13] = 0.000803467; luma_filter[14] = 0.000363199; luma_filter[15] = 0.000013422; luma_filter[16] = 0.000253402; luma_filter[17] = 0.001339461; luma_filter[18] = 0.002932972; luma_filter[19] = 0.003983485; luma_filter[20] = 0.003026683; luma_filter[21] = -0.001102056; luma_filter[22] = -0.008373026; luma_filter[23] = -0.016897700; luma_filter[24] = -0.022914480; luma_filter[25] = -0.021642347; luma_filter[26] = -0.008863273; luma_filter[27] = 0.017271957; luma_filter[28] = 0.054921920; luma_filter[29] = 0.098342579; luma_filter[30] = 0.139044281; luma_filter[31] = 0.168055832; luma_filter[32] = 0.178571429; - float chroma_filter[33]; chroma_filter[0] = 0.001384762; chroma_filter[1] = 0.001678312; chroma_filter[2] = 0.002021715; chroma_filter[3] = 0.002420562; chroma_filter[4] = 0.002880460; chroma_filter[5] = 0.003406879; chroma_filter[6] = 0.004004985; chroma_filter[7] = 0.004679445; chroma_filter[8] = 0.005434218; chroma_filter[9] = 0.006272332; chroma_filter[10] = 0.007195654; chroma_filter[11] = 0.008204665; chroma_filter[12] = 0.009298238; chroma_filter[13] = 0.010473450; chroma_filter[14] = 0.011725413; chroma_filter[15] = 0.013047155; chroma_filter[16] = 0.014429548; chroma_filter[17] = 0.015861306; chroma_filter[18] = 0.017329037; chroma_filter[19] = 0.018817382; chroma_filter[20] = 0.020309220; chroma_filter[21] = 0.021785952; chroma_filter[22] = 0.023227857; chroma_filter[23] = 0.024614500; chroma_filter[24] = 0.025925203; chroma_filter[25] = 0.027139546; chroma_filter[26] = 0.028237893; chroma_filter[27] = 0.029201910; chroma_filter[28] = 0.030015081; chroma_filter[29] = 0.030663170; chroma_filter[30] = 0.031134640; chroma_filter[31] = 0.031420995; chroma_filter[32] = 0.031517031; - half3 signal = half3(0.0,0.0,0.0); - half3 norm = half3(0.0,0.0,0.0); - half3 adj = half3(0.0,0.0,0.0); - int taps = bleedLength - 4; - for (int ii = 0; ii < taps % 1023; ii++) - { - float offset = float(ii); - half3 sums = fetch_offset(offset - float(taps), ONE_X) + fetch_offset(float(taps) - offset, ONE_X); - adj = half3(luma_filter[ii + 3], chroma_filter[ii], chroma_filter[ii]); - signal += sums * adj; - norm += adj; - } - adj = half3(luma_filter[taps], chroma_filter[taps], chroma_filter[taps]); - half4 col23 = tex2D(_MainTex, fixCoord); - signal += rgb2yiq(col23.rgb) * adj; - norm += adj; - signal = signal / norm; - float3 rgb = yiq2rgb(signal); - - float alpha = col23.a + (rgb.r + rgb.g + rgb.b) / 3; - return half4(rgb, alpha); - } - - fixed4 frag (v2f i) : SV_Target - { - #if _NTSCOld3Phase - return FragNTSCOld3Phase(i); - #elif _NTSC3Phase - return FragNTSC3Phase(i); - #else - return FragNTSC2Phase(i); - #endif - } - ENDCG - } - } -} diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader.meta deleted file mode 100644 index d5e2b768..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_Bleed.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d7b367e99136835468184ea471e79e02 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader deleted file mode 100644 index b5d99176..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader +++ /dev/null @@ -1,144 +0,0 @@ -Shader "Filter/RLPro_CRT_Aperture" -{ - Properties - { - _MainTex ("Base (RGB)", 2D) = "white" {} - } - SubShader - { - Pass - { - CGPROGRAM - - #pragma shader_feature_local _NTSCOld3Phase _NTSC3Phase _NTSC2Phase - #pragma vertex vert_img - #pragma fragment Frag0 - #include "UnityCG.cginc" - - #define FIX(c) max(abs(c), 1e-5) - #define saturate(c) clamp(c, 0.0, 1.0) - #define PI 3.14159265359 - - sampler2D _MainTex; - float4 _MainTex_TexelSize; - float2 _iResolution; - - float GLOW_HALATION = 0.1; - float GLOW_DIFFUSION = 0.05; - float MASK_COLORS = 2.0; - float MASK_STRENGTH = 0.3; - float GAMMA_INPUT = 2.4; - float GAMMA_OUTPUT = 2.4; - float BRIGHTNESS = 1.5; - - struct v2f - { - float4 pos : POSITION; - float2 uv : TEXCOORD0; - }; - - float mod(float x, float y) - { - return x - y * floor(x / y); - } - - float fract(float x) - { - return x - floor(x); - } - - float2 fract(float2 x) - { - return x - floor(x); - } - - float4 fract(float4 x) - { - return x - floor(x); - } - - float3 TEX2D(float2 c) - { - return pow(abs(tex2D(_MainTex, c).rgb), float3(GAMMA_INPUT, GAMMA_INPUT, GAMMA_INPUT)).xyz; - } - - float3x3 get_color_matrix(float2 co, float2 dx) - { - return float3x3(TEX2D(co - dx), TEX2D(co), TEX2D(co + dx)); - } - - float3 blur(float3x3 m, float dist, float rad) - { - float3 x = float3(dist - 1.0, dist, dist + 1.0) / rad; - float3 w = exp2(x * x * -1.0); - - return (m[0] * w.x + m[1] * w.y + m[2] * w.z) / (w.x + w.y + w.z); - } - - float3 filter_gaussian(float2 co, float2 tex_size) - { - float2 dx = float2(1.0 / tex_size.x, 0.0); - float2 dy = float2(0.0, 1.0 / tex_size.y); - float2 pix_co = co * tex_size; - float2 tex_co = (floor(pix_co) + 0.5) / tex_size; - float2 dist = (fract(pix_co) - 0.5) * -1.0; - float3x3 line0 = get_color_matrix(tex_co - dy, dx); - float3x3 line1 = get_color_matrix(tex_co, dx); - float3x3 line2 = get_color_matrix(tex_co + dy, dx); - float3x3 column = float3x3(blur(line0, dist.x, 0.5), blur(line1, dist.x, 0.5), blur(line2, dist.x, 0.5)); - return blur(column, dist.y, 0.5); - } - - float3 filter_lanczos(float2 co, float2 tex_size, float sharp) - { - tex_size.x *= sharp; - - float2 dx = float2(1.0 / tex_size.x, 0.0); - float2 pix_co = co * tex_size - float2(0.5, 0.0); - float2 tex_co = (floor(pix_co) + float2(0.5, 0.001)) / tex_size; - float2 dist = fract(pix_co); - float4 coef = PI * float4(dist.x + 1.0, dist.x, dist.x - 1.0, dist.x - 2.0); - coef = FIX(coef); - coef = 2.0 * sin(coef) * sin(coef / 2.0) / (coef * coef); - coef /= dot(coef, float4(1.0, 1.0, 1.0, 1.0)); - float4 col1 = float4(TEX2D(tex_co), 1.0); - float4 col2 = float4(TEX2D(tex_co + dx), 1.0); - float4x4 fkfk = mul(coef.x, float4x4(col1, col1, col2, col2)); - float4x4 fkfks = mul(coef.y, float4x4(col1, col1, col2, col2)); - float4x4 fkfkb = mul(coef.z, float4x4(col1, col1, col2, col2)); - return float3(fkfk[0].x, fkfk[0].y, fkfk[0].z); - } - - float3 mix(float3 x, float3 y, float3 a) { - return float3(x * (1 - a) + y * a); - } - - float3 get_mask_weight(float x) - { - float i = mod(floor(x), MASK_COLORS); - if (i == 0.0) return mix(float3(1.0, 0.0, 1.0), float3(1.0, 0.0, 0.0), MASK_COLORS - 2.0); - else if (i == 1.0) return float3(0.0, 1.0, 0.0); - else return float3(0.0, 0.0, 1.0); - } - - float4 Frag0(v2f i) : SV_Target - { - float2 pos = i.uv; - float3 col_glow = filter_gaussian(pos, _ScreenParams.xy); - float3 col_soft = filter_lanczos(pos, _ScreenParams.xy, 1); - float3 col_sharp = filter_lanczos(pos, _ScreenParams.xy, 3); - float3 col = sqrt(col_sharp * col_soft); - col_glow = saturate(col_glow - col); - col += col_glow * col_glow * GLOW_HALATION; - col = mix(col, col * get_mask_weight(pos.x) * MASK_COLORS, MASK_STRENGTH); - col += col_glow * GLOW_DIFFUSION; - col = pow(abs(col * BRIGHTNESS), float3(1.0 / GAMMA_OUTPUT, 1.0 / GAMMA_OUTPUT, 1.0 / GAMMA_OUTPUT)); - half4 col1 = tex2D(_MainTex, pos); - float fade = 1; - - return lerp(col1,float4(col, col1.a+(col.r+col.g+col.b)/3),fade); - } - ENDCG - } - } -} diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader.meta deleted file mode 100644 index 8304beb7..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_CRT_Aperture.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f63497435389f8548ab973da8535e1b5 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader deleted file mode 100644 index 0be47b3d..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader +++ /dev/null @@ -1,162 +0,0 @@ -Shader "Filter/RLPro_TV_Effect" -{ - Properties - { - _MainTex ("Base (RGB)", 2D) = "white" {} - } - SubShader - { - Pass - { - CGPROGRAM - - #pragma shader_feature_local _SimpleWrap _CubicDistortion - #pragma vertex vert_img - #pragma fragment Frag - #include "UnityCG.cginc" - - sampler2D _MainTex; - float4 _MainTex_TexelSize; - float2 _iResolution; - - float maskDark = 0.5; - float maskLight = 1.5; - float hardScan = -8.0; - float hardPix = -3.0; - float2 warp = float2(1.0 / 32.0, 1.0 / 24.0); - float2 res; - float resScale; - float scale; - float fade; - - struct v2f - { - float4 pos : POSITION; - float2 uv : TEXCOORD0; - }; - - float3 Fetch(float2 pos, float2 off) - { - pos = floor(pos * res + off) / res; - return tex2Dlod(_MainTex, float4(pos.xy, 0, -16.0)).rgb; - } - - float2 Dist(float2 pos) { pos = pos * res; return -((pos - floor(pos)) - float2(0.5, 0.5)); } - float Gaus(float pos, float scale) { return exp2(scale * pos * pos); } - - float3 Horz3(float2 pos, float off) - { - float3 b = Fetch(pos, float2(-1.0, off)); - float3 c = Fetch(pos, float2(0.0, off)); - float3 d = Fetch(pos, float2(1.0, off)); - float dst = Dist(pos).x; - float scale = hardPix; - float wb = Gaus(dst - 1.0, scale); - float wc = Gaus(dst + 0.0, scale); - float wd = Gaus(dst + 1.0, scale); - return (b * wb + c * wc + d * wd) / (wb + wc + wd); - } - - float3 Horz5(float2 pos, float off) - { - float3 a = Fetch(pos, float2(-2.0, off)); - float3 b = Fetch(pos, float2(-1.0, off)); - float3 c = Fetch(pos, float2(0.0, off)); - float3 d = Fetch(pos, float2(1.0, off)); - float3 e = Fetch(pos, float2(2.0, off)); - float dst = Dist(pos).x; - float scale = hardPix; - float wa = Gaus(dst - 2.0, scale); - float wb = Gaus(dst - 1.0, scale); - float wc = Gaus(dst + 0.0, scale); - float wd = Gaus(dst + 1.0, scale); - float we = Gaus(dst + 2.0, scale); - return (a * wa + b * wb + c * wc + d * wd + e * we) / (wa + wb + wc + wd + we); - } - - float Scan(float2 pos, float off) - { - float dst = Dist(pos).y; - return Gaus(dst + off, hardScan); - } - - float3 Tri(float2 pos) - { - float3 a = Horz3(pos, -1.0); - float3 b = Horz5(pos, 0.0); - float3 c = Horz3(pos, 1.0); - float wa = Scan(pos, -1.0); - float wb = Scan(pos, 0.0); - float wc = Scan(pos, 1.0); - return a * wa + b * wb + c * wc; - } - - float2 Warp(float2 pos) - { - float2 h = pos - float2(0.5, 0.5); - float r2 = dot(h, h); - float f = 1.0 + r2 * (warp.x + warp.y * sqrt(r2)); - return f * scale * h + 0.5; - } - - float2 Warp1(float2 pos) - { - pos = pos * 2.0 - 1.0; - pos *= float2(1.0 + (pos.y * pos.y) * warp.x, 1.0 + (pos.x * pos.x) * warp.y); - return pos * scale + 0.5; - } - - float3 Mask(float2 pos) - { - pos.x += pos.y * 3.0; - float3 mask = float3(maskDark, maskDark, maskDark); - pos.x = frac(pos.x / 6.0); - if (pos.x < 0.333)mask.r = maskLight; - else if (pos.x < 0.666)mask.g = maskLight; - else mask.b = maskLight; - return mask; - } - - float4 SimpleWrapFrag(v2f i) - { - float2 uv = i.uv; - - float4 col = tex2D(_MainTex,uv); - res = _ScreenParams.xy / resScale; - float2 fragCoord = uv * _ScreenParams.xy; - float4 fragColor = 0; - float2 pos = Warp1(fragCoord.xy / _ScreenParams.xy); - fragColor.rgb = Tri(pos) * Mask(fragCoord); - fragColor.a = tex2D(_MainTex,pos).a; - - return lerp(col,fragColor,fade); - } - - float4 CubicDistortionFrag(v2f i) - { - float2 uv = i.uv; - - float4 col = tex2D(_MainTex,uv); - res = _iResolution.xy / resScale; - float2 fragCoord = uv * _ScreenParams.xy; - float4 fragColor = 0; - float2 pos = Warp(fragCoord.xy / _ScreenParams.xy); - fragColor.rgb = Tri(pos) * Mask(fragCoord); - fragColor.a = tex2D(_MainTex,pos).a; - - return lerp(col,fragColor,fade); - } - - float4 Frag(v2f i) : SV_Target - { -#if _SimpleWrap - return SimpleWrapFrag(i); -#else - return CubicDistortionFrag(i); -#endif - } - - ENDCG - } - } -} diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader.meta b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader.meta deleted file mode 100644 index 1aceaad1..00000000 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPro_TV_Effect.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: bef4d98671a3c524f9bfdba0d25e5991 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: