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

Commit 317608b

Browse files
committed
Clamp volume weight to [0;1]
1 parent b29a561 commit 317608b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PostProcessing/Runtime/PostProcessManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ internal void UpdateSettings(PostProcessLayer postProcessLayer)
313313
// Global volume always have influence
314314
if (volume.isGlobal)
315315
{
316-
postProcessLayer.OverrideSettings(settings, volume.weight);
316+
postProcessLayer.OverrideSettings(settings, Mathf.Clamp01(volume.weight));
317317
continue;
318318
}
319319

@@ -358,7 +358,7 @@ internal void UpdateSettings(PostProcessLayer postProcessLayer)
358358
interpFactor = 1f - (closestDistanceSqr / blendDistSqr);
359359

360360
// No need to clamp01 the interpolation factor as it'll always be in [0;1[ range
361-
postProcessLayer.OverrideSettings(settings, interpFactor * volume.weight);
361+
postProcessLayer.OverrideSettings(settings, interpFactor * Mathf.Clamp01(volume.weight));
362362
}
363363
}
364364
}

0 commit comments

Comments
 (0)