Skip to content

Commit

Permalink
fix(ScreenFade): ensure alpha does not get locked at 1f
Browse files Browse the repository at this point in the history
There was a bug where the alpha would not get set fully to 1f so
a fix was introduced to force it to 1f if the alpha was over 0.98f.

However, this created another bug where when the alpha should go from
1f to lower it would keep getting reset to 1f.

This fix checks to see if the alpha is being changed up towards the
1f value before attempting to force the alpha to 1f above 0.98f.
  • Loading branch information
thestonefox committed May 13, 2017
1 parent f5ce613 commit 7c841b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/VRTK/Scripts/Internal/VRTK_ScreenFade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected virtual void OnPostRender()

if (currentColor.a > 0 && fadeMaterial)
{
currentColor.a = (currentColor.a > 0.98f ? 1f : currentColor.a);
currentColor.a = (targetColor.a > currentColor.a && currentColor.a > 0.98f ? 1f : currentColor.a);
fadeMaterial.color = currentColor;
fadeMaterial.SetPass(0);
GL.PushMatrix();
Expand Down

0 comments on commit 7c841b6

Please sign in to comment.