當前位置: 首頁>>代碼示例>>C#>>正文


C# OpenGL.VertexAttribDivisor方法代碼示例

本文整理匯總了C#中SharpGL.OpenGL.VertexAttribDivisor方法的典型用法代碼示例。如果您正苦於以下問題:C# OpenGL.VertexAttribDivisor方法的具體用法?C# OpenGL.VertexAttribDivisor怎麽用?C# OpenGL.VertexAttribDivisor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpGL.OpenGL的用法示例。


在下文中一共展示了OpenGL.VertexAttribDivisor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BindVBOs

        public void BindVBOs(OpenGL gl, LinesProgram program)
        {
            var attribPos = program.Attribs["Position"];
            gl.BindBuffer(_vboTarget, Position);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["ColorValue"];
            gl.BindBuffer(_vboTarget, ColorValue);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            if (IndicesCount > 0)
                gl.BindBuffer(_iboTarget, Ibo);
        }
開發者ID:jochemgeussens,項目名稱:sharpgl,代碼行數:16,代碼來源:LinesBufferGroup.cs

示例2: BindNMVBOs

        public void BindNMVBOs(OpenGL gl, NormalMaterialProgram program)
        {
            var attribPos = program.Attribs["Position"];
            gl.BindBuffer(_vboTarget, Position);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["Normal"];
            gl.BindBuffer(_vboTarget, Normal);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["AmbientMaterial"];
            gl.BindBuffer(_vboTarget, AmbientMaterial);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["DiffuseMaterial"];
            gl.BindBuffer(_vboTarget, DiffuseMaterial);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["SpecularMaterial"];
            gl.BindBuffer(_vboTarget, SpecularMaterial);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["ShininessValue"];
            gl.BindBuffer(_vboTarget, ShininessValue);
            gl.VertexAttribPointer(attribPos, 1, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            gl.BindBuffer(_iboTarget, Ibo);
        }
開發者ID:jochemgeussens,項目名稱:sharpgl,代碼行數:38,代碼來源:NMHTBufferGroup.cs

示例3: BindHTVBOs

        public void BindHTVBOs(OpenGL gl, HitTestProgram program)
        {
            var attribPos = program.Attribs["Position"];
            gl.BindBuffer(_vboTarget, Position);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.EnableVertexAttribArray(attribPos);

            attribPos = program.Attribs["HTColorId"];
            gl.BindBuffer(_vboTarget, HTColorId);
            gl.VertexAttribPointer(attribPos, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero);
            gl.VertexAttribDivisor(attribPos, 1);
            gl.EnableVertexAttribArray(attribPos);

            gl.BindBuffer(_iboTarget, Ibo);
        }
開發者ID:jochemgeussens,項目名稱:sharpgl,代碼行數:15,代碼來源:NMHTBufferGroup.cs

示例4: Invoke

 public void Invoke(OpenGL gl)
 {
     //CurrentVariant.Invoke(gl);
     gl.VertexAttribPointer(Index, Size, (uint)Type, Normalized, Stride, OffsetPointer);
     if (DivisorValue > 0)
     {
         gl.VertexAttribDivisor(Index, DivisorValue);
     }
 }
開發者ID:jochemgeussens,項目名稱:OpenGLHelper-Using-SharpGL,代碼行數:9,代碼來源:VertexAttribPointer.cs


注:本文中的SharpGL.OpenGL.VertexAttribDivisor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。