diff --git a/Assets/Kino/Bloom/Bloom.cs b/Assets/Kino/Bloom/Bloom.cs index 50884c3..2501eec 100644 --- a/Assets/Kino/Bloom/Bloom.cs +++ b/Assets/Kino/Bloom/Bloom.cs @@ -163,7 +163,6 @@ void OnDisable() void OnRenderImage(RenderTexture source, RenderTexture destination) { var useRGBM = Application.isMobilePlatform; - var isGamma = QualitySettings.activeColorSpace == ColorSpace.Gamma; // source texture size var tw = source.width; @@ -209,17 +208,6 @@ void OnRenderImage(RenderTexture source, RenderTexture destination) else _material.DisableKeyword("ANTI_FLICKER"); - if (isGamma) - { - _material.DisableKeyword("LINEAR_COLOR"); - _material.EnableKeyword("GAMMA_COLOR"); - } - else - { - _material.EnableKeyword("LINEAR_COLOR"); - _material.DisableKeyword("GAMMA_COLOR"); - } - // prefilter pass var prefiltered = RenderTexture.GetTemporary(tw, th, 0, rtFormat); Graphics.Blit(source, prefiltered, _material, 0); diff --git a/Assets/Kino/Bloom/Shader/Bloom.shader b/Assets/Kino/Bloom/Shader/Bloom.shader index 7f6bc40..8efd8d4 100644 --- a/Assets/Kino/Bloom/Shader/Bloom.shader +++ b/Assets/Kino/Bloom/Shader/Bloom.shader @@ -198,7 +198,7 @@ Shader "Hidden/Kino/Bloom" half3 m = s0.rgb; #endif - #if GAMMA_COLOR + #if UNITY_COLORSPACE_GAMMA m = GammaToLinearSpace(m); #endif // Pixel brightness @@ -239,11 +239,11 @@ Shader "Hidden/Kino/Bloom" { half4 base = tex2D(_BaseTex, i.uvBase); half3 blur = UpsampleFilter(i.uvMain); - #if GAMMA_COLOR + #if UNITY_COLORSPACE_GAMMA base.rgb = GammaToLinearSpace(base.rgb); #endif half3 cout = base.rgb + blur * _Intensity; - #if GAMMA_COLOR + #if UNITY_COLORSPACE_GAMMA cout = LinearToGammaSpace(cout); #endif return half4(cout, base.a); @@ -257,7 +257,7 @@ Shader "Hidden/Kino/Bloom" ZTest Always Cull Off ZWrite Off CGPROGRAM #pragma multi_compile _ ANTI_FLICKER - #pragma multi_compile LINEAR_COLOR GAMMA_COLOR + #pragma multi_compile _ UNITY_COLORSPACE_GAMMA #pragma vertex vert_img #pragma fragment frag_prefilter #pragma target 3.0 @@ -297,7 +297,7 @@ Shader "Hidden/Kino/Bloom" ZTest Always Cull Off ZWrite Off CGPROGRAM #pragma multi_compile _ HIGH_QUALITY - #pragma multi_compile LINEAR_COLOR GAMMA_COLOR + #pragma multi_compile _ UNITY_COLORSPACE_GAMMA #pragma vertex vert_multitex #pragma fragment frag_upsample_final #pragma target 3.0