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

Commit 9ad01a7

Browse files
committed
Fixed NPE in autoexposure
1 parent 88ce0b6 commit 9ad01a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PostProcessing/Runtime/Effects/AutoExposure.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ public override void Render(PostProcessRenderContext context)
9797
settings.maxLuminance.value = Mathf.Max(minLum, maxLum);
9898

9999
// Compute average luminance & auto exposure
100-
bool isStatic = m_ResetHistory || !Application.isPlaying;
100+
bool firstFrame = m_ResetHistory || !Application.isPlaying;
101101
string adaptation = null;
102102

103-
if (isStatic)
103+
if (firstFrame || settings.eyeAdaptation.value == EyeAdaptation.Fixed)
104104
adaptation = "KAutoExposureAvgLuminance_fixed";
105-
else if (settings.eyeAdaptation.value == EyeAdaptation.Progressive)
105+
else
106106
adaptation = "KAutoExposureAvgLuminance_progressive";
107107

108108
var compute = context.resources.computeShaders.autoExposure;
@@ -112,7 +112,7 @@ public override void Render(PostProcessRenderContext context)
112112
cmd.SetComputeVectorParam(compute, "_Params2", new Vector4(settings.speedDown.value, settings.speedUp.value, settings.keyValue.value, Time.deltaTime));
113113
cmd.SetComputeVectorParam(compute, "_ScaleOffsetRes", context.logHistogram.GetHistogramScaleOffsetRes(context));
114114

115-
if (isStatic)
115+
if (firstFrame)
116116
{
117117
// We don't want eye adaptation when not in play mode because the GameView isn't
118118
// animated, thus making it harder to tweak. Just use the final audo exposure value.

0 commit comments

Comments
 (0)