void OnPostRender()
{
if (!Material)
{
Debug.LogError("Please Assign a material on the inspector");
return;
}
GL.PushMatrix();
Material.SetPass(0);
GL.LoadOrtho();
GL.Begin(GL.QUADS);
GL.TexCoord2(0, 0);GL.Vertex3(0.25F, 0.25F, 0);//屏幕左下角
GL.TexCoord2(0, 1);GL.Vertex3(0.25F, 0.75F, 0);//屏幕左上角
GL.TexCoord2(1, 1);GL.Vertex3(0.75F, 0.75F, 0);//屏幕右上角
GL.TexCoord2(1, 0);GL.Vertex3(0.75F, 0.25F, 0);//屏幕右下角
GL.End();
GL.PopMatrix();
}
用GL绘制一个矩形