Skip to content

Commit

Permalink
fix(ScreenFade): ensure screen fade reaches full opacity
Browse files Browse the repository at this point in the history
The VRTK_ScreenFade script could get into a state where it should be
at an opacity of 1f but would end up at 0.9999f which meant the quad
wasn't completely opaque so items in the scene were still barely
visible.

This fix forces the alpha channel to 1f if it exceeds 0.98f.
  • Loading branch information
thestonefox committed Apr 22, 2017
1 parent 28fc7d9 commit dcd6945
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/VRTK/Scripts/Internal/VRTK_ScreenFade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected virtual void OnPostRender()

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

0 comments on commit dcd6945

Please sign in to comment.