Skip to content

Commit

Permalink
Merge pull request keijiro#5 from keijiro/shader-fixes
Browse files Browse the repository at this point in the history
Change for reducing the number of shader variants.
  • Loading branch information
keijiro committed Apr 13, 2016
2 parents 8935d57 + cada07d commit 4a4cc02
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Assets/Kino/Bloom/Shader/Bloom.shader
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ Shader "Hidden/Kino/Bloom"

#include "UnityCG.cginc"

#pragma multi_compile _ HIGH_QUALITY
#pragma multi_compile _ ANTI_FLICKER
#pragma multi_compile LINEAR_COLOR GAMMA_COLOR

// Mobile: use RGBM instead of float/half RGB
#define USE_RGBM defined(SHADER_API_MOBILE)

Expand Down Expand Up @@ -103,8 +99,6 @@ Shader "Hidden/Kino/Bloom"
return s * (1.0 / 4);
}

#if ANTI_FLICKER

// Downsample with a 4x4 box filter + anti-flicker filter
half3 DownsampleAntiFlickerFilter(float2 uv)
{
Expand All @@ -125,8 +119,6 @@ Shader "Hidden/Kino/Bloom"
return (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * one_div_wsum;
}

#endif

half3 UpsampleFilter(float2 uv)
{
#if HIGH_QUALITY
Expand Down Expand Up @@ -264,6 +256,8 @@ Shader "Hidden/Kino/Bloom"
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma multi_compile _ ANTI_FLICKER
#pragma multi_compile LINEAR_COLOR GAMMA_COLOR
#pragma vertex vert_img
#pragma fragment frag_prefilter
#pragma target 3.0
Expand All @@ -273,6 +267,7 @@ Shader "Hidden/Kino/Bloom"
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma multi_compile _ ANTI_FLICKER
#pragma vertex vert_img
#pragma fragment frag_downsample1
#pragma target 3.0
Expand All @@ -291,6 +286,7 @@ Shader "Hidden/Kino/Bloom"
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma multi_compile _ HIGH_QUALITY
#pragma vertex vert_multitex
#pragma fragment frag_upsample
#pragma target 3.0
Expand All @@ -300,6 +296,8 @@ Shader "Hidden/Kino/Bloom"
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma multi_compile _ HIGH_QUALITY
#pragma multi_compile LINEAR_COLOR GAMMA_COLOR
#pragma vertex vert_multitex
#pragma fragment frag_upsample_final
#pragma target 3.0
Expand Down

0 comments on commit 4a4cc02

Please sign in to comment.