示例#1
0
        public void drawToPickBuffer(ShaderProgram shader, Matrix4 view)
        {
            shader.Use();
            shader.setUniform("model", this.transform);
            shader.setUniform("view", view);
            shader.setUniform("pickColor", this.pickColor);

            Vao.Bind();

            GL.DrawArrays(PrimitiveType.Triangles, 0, Vao.Lenth);

            Vao.Unbind();
        }
示例#2
0
        public void draw(Camera cam)
        {
            GL.DepthFunc(DepthFunction.Lequal);
            GL.CullFace(CullFaceMode.Front);

            GL.BindTexture(TextureTarget.TextureCubeMap, Texture);

            Shader.Use();
            Shader.setUniform("proj", cam.Projection);
            Shader.setUniform("view", cam.Transfrom);

            GL.BindVertexArray(vao);
            //GL.DrawArrays(PrimitiveType.Quads, 0, verts_f.Length);
            GL.DrawElements(PrimitiveType.Quads, elems_u.Length, DrawElementsType.UnsignedInt, 0);
            GL.BindVertexArray(0);

            GL.DepthFunc(DepthFunction.Less);
            GL.CullFace(CullFaceMode.Back);
        }