Unity GL Triangles

private void OnPostRender()
    {
//material 材质使用UI/default或者GL.invertCulling = true;       
        GL.PushMatrix();
        _mat.SetPass(0); 使用UI/Default shader
        GL.LoadOrtho();
        GL.invertCulling = true;
        //GL.Begin(GL.TRIANGLE_STRIP);
        GL.Begin(GL.TRIANGLES);
        //GL.Color(new Color(0, 0, 0, 1));
        GL.Vertex3(0.25f, 0.5f, 0);
        GL.Vertex3(0, 0.5f, 0);
        GL.Vertex3(0.25f, 0.25f, 0);
        //GL.Vertex3(0, 0.25f, 0);
        GL.End();
        GL.PopMatrix();
}

GL在屏幕上画三角形不可见,设置材质或GL.invertCulling = true;

猜你喜欢

转载自blog.csdn.net/yaoyutian/article/details/83783304
今日推荐