Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 7d472a8

Browse files
committed
Reduced the amount of variants for the uber shader (9216 -> 6912)
1 parent d421ce9 commit 7d472a8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

PostProcessing/Resources/Shaders/Uber.shader

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ Shader "Hidden/Post FX/Uber Shader"
2222
#pragma multi_compile __ EYE_ADAPTATION
2323
#pragma multi_compile __ CHROMATIC_ABERRATION
2424
#pragma multi_compile __ DEPTH_OF_FIELD DEPTH_OF_FIELD_COC_VIEW
25-
#pragma multi_compile __ BLOOM
26-
#pragma multi_compile __ BLOOM_LENS_DIRT
25+
#pragma multi_compile __ BLOOM BLOOM_LENS_DIRT
2726
#pragma multi_compile __ COLOR_GRADING COLOR_GRADING_LOG_VIEW
2827
#pragma multi_compile __ USER_LUT
2928
#pragma multi_compile __ GRAIN
@@ -218,7 +217,7 @@ Shader "Hidden/Post FX/Uber Shader"
218217
#endif
219218

220219
// HDR Bloom
221-
#if BLOOM
220+
#if BLOOM || BLOOM_LENS_DIRT
222221
{
223222
half3 bloom = UpsampleFilter(_BloomTex, i.uvFlippedSPR, _BloomTex_TexelSize.xy, _Bloom_Settings.x) * _Bloom_Settings.y;
224223
color += bloom;

PostProcessing/Runtime/Components/BloomComponent.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public void Prepare(RenderTexture source, Material uberMaterial, Texture autoExp
129129
context.renderTextureFactory.Release(prefiltered);
130130

131131
// Push everything to the uber material
132-
uberMaterial.EnableKeyword("BLOOM");
133132
uberMaterial.SetTexture(Uniforms._BloomTex, bloomTex);
134133
uberMaterial.SetVector(Uniforms._Bloom_Settings, new Vector2(sampleScale, bloom.intensity));
135134

@@ -139,6 +138,10 @@ public void Prepare(RenderTexture source, Material uberMaterial, Texture autoExp
139138
uberMaterial.SetFloat(Uniforms._Bloom_DirtIntensity, lensDirt.intensity);
140139
uberMaterial.EnableKeyword("BLOOM_LENS_DIRT");
141140
}
141+
else
142+
{
143+
uberMaterial.EnableKeyword("BLOOM");
144+
}
142145
}
143146
}
144147
}

0 commit comments

Comments
 (0)