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

Commit fc10e4f

Browse files
committed
Added a fail-safe to bloom
Pushing diffusion higher than its designated maximum value would break bloom at low resolutions
1 parent ca1ce0f commit fc10e4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PostProcessing/Runtime/Effects/Bloom.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public override void Render(PostProcessRenderContext context)
8888
sheet.properties.SetTexture(ShaderIDs.AutoExposureTex, context.autoExposureTexture);
8989

9090
// Determine the iteration count
91-
float logh = Mathf.Log(context.height, 2f) + settings.diffusion.value - 10f;
91+
float logh = Mathf.Log(context.height, 2f) + Mathf.Min(settings.diffusion.value, 10f) - 10f;
9292
int logh_i = Mathf.FloorToInt(logh);
9393
int iterations = Mathf.Clamp(logh_i, 1, k_MaxPyramidSize);
9494
float sampleScale = 0.5f + logh - logh_i;

0 commit comments

Comments
 (0)