Skip to content

Commit 2de37eb

Browse files
committed
Fixed VR fade bug
i have no idea why bug happened, i have no idea how did i fixed it. (i changed the shader...)
1 parent f8e734d commit 2de37eb

3 files changed

Lines changed: 10 additions & 108 deletions

File tree

NewAPI/seyahdoo/fadevr/Fader.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class Fader : other.Singleton<Fader>
4242
[SerializeField]
4343
private Color fadeColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
4444

45+
//[SerializeField]
4546
private Material fadeMaterial = null;
4647

4748
private bool fading = false;
@@ -53,10 +54,9 @@ public class Fader : other.Singleton<Fader>
5354

5455
void Awake()
5556
{
56-
fadeMaterial = new Material(Shader.Find("Unlit/Transparent HUD (ScreenFader)"));
57+
fadeMaterial = new Material(Shader.Find("Oculus/Unlit Transparent Color"));
5758
fadeMaterial.color = fadeColor;
5859
AddCameraControlls();
59-
6060
}
6161

6262
void AddCameraControlls()
@@ -111,14 +111,13 @@ private IEnumerator DoFade()
111111
private class ScreenFadeControl : MonoBehaviour
112112
{
113113
public Material fadeMaterial = null;
114-
115-
// Based on OVRScreenFade
116-
#if UNITY_ANDROID && !UNITY_EDITOR
117-
void OnCustomPostRender()
118-
#else
114+
115+
/// <summary>
116+
/// Renders the fade overlay when attached to a camera object
117+
/// </summary>
119118
void OnPostRender()
120-
#endif
121119
{
120+
122121
fadeMaterial.SetPass(0);
123122
GL.PushMatrix();
124123
GL.LoadOrtho();
@@ -130,7 +129,10 @@ void OnPostRender()
130129
GL.Vertex3(1f, 0f, -12f);
131130
GL.End();
132131
GL.PopMatrix();
132+
133133
}
134+
135+
134136
}
135137

136138
/// <summary>

NewAPI/seyahdoo/fadevr/Unlit Transparent HUD.shader

Lines changed: 0 additions & 100 deletions
This file was deleted.
-1.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)