Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Attach this script to the camera
- using UnityEngine;
- public class FullScreenQuad : MonoBehaviour
- {
- public Material fullScreenStencilMat;
- private void OnPostRender()
- {
- fullScreenStencilMat.SetPass(0);
- GL.PushMatrix();
- GL.LoadPixelMatrix(0, 1, 0, 1);
- GL.modelview = Matrix4x4.identity;
- GL.Color(Color.white);
- GL.Begin(GL.QUADS);
- GL.Vertex3(0, 0, 0);
- GL.Vertex3(0, 1, 0);
- GL.Vertex3(1, 1, 0);
- GL.Vertex3(1, 0, 0);
- GL.End();
- GL.PopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement