@@ -50,8 +50,6 @@ public sealed class AutoExposureRenderer : PostProcessEffectRenderer<AutoExposur
5050 int m_AutoExposurePingPong ;
5151 RenderTexture m_CurrentAutoExposure ;
5252
53- bool m_FirstFrame = true ;
54-
5553 void CheckTexture ( int id )
5654 {
5755 if ( m_AutoExposurePool [ id ] == null || ! m_AutoExposurePool [ id ] . IsCreated ( ) )
@@ -93,7 +91,7 @@ public override void Render(PostProcessRenderContext context)
9391 sheet . properties . SetVector ( ShaderIDs . ScaleOffsetRes , context . logHistogram . GetHistogramScaleOffsetRes ( context ) ) ;
9492 sheet . properties . SetFloat ( ShaderIDs . ExposureCompensation , settings . keyValue . value ) ;
9593
96- if ( m_FirstFrame || ! Application . isPlaying )
94+ if ( m_ResetHistory || ! Application . isPlaying )
9795 {
9896 // We don't want eye adaptation when not in play mode because the GameView isn't
9997 // animated, thus making it harder to tweak. Just use the final audo exposure value.
@@ -102,6 +100,8 @@ public override void Render(PostProcessRenderContext context)
102100
103101 // Copy current exposure to the other pingpong target to avoid adapting from black
104102 RuntimeUtilities . CopyTexture ( cmd , m_AutoExposurePool [ 0 ] , m_AutoExposurePool [ 1 ] ) ;
103+
104+ m_ResetHistory = false ;
105105 }
106106 else
107107 {
@@ -117,7 +117,6 @@ public override void Render(PostProcessRenderContext context)
117117
118118 context . autoExposureTexture = m_CurrentAutoExposure ;
119119 context . autoExposure = settings ;
120- m_FirstFrame = false ;
121120 }
122121
123122 public override void Release ( )
0 commit comments