Created
May 11, 2018 00:50
-
-
Save edom18/5111163139ab6385fc85415b7f0d4cbd to your computer and use it in GitHub Desktop.
UnityでVR開発していてフェードを簡単に行いたい場合の処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnRenderImage(RenderTexture src, RenderTexture dest) | |
{ | |
_fadeMaterial.SetPass(0); | |
GL.PushMatrix(); | |
GL.LoadOrtho(); | |
GL.Color(_fadeMaterial.color); // Update内などでこのcolorを変更する想定 | |
GL.Begin(GL.QUADS); | |
GL.Vertex3(-1f, -1f, 1f); | |
GL.Vertex3(-1f, 1f, 1f); | |
GL.Vertex3( 1f, 1f, 1f); | |
GL.Vertex3( 1f, -1f, 1f); | |
GL.End(); | |
GL.PopMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment