当前位置: 首页>>代码示例>>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;未经允许,请勿转载。