Пример #1
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw(GraphicsContext context, int count = 1)
        {
            // 頂点バッファバインド
            context.SetVertexBuffer(0, vertexBuffer_);

            // マテリアル
            material_.Setup(context);
            ShaderManager.SetUniformParams(ref worldMatrix_);

            // 描画
            if (count > 1)
            {
                context.DrawInstanced(0, vertexNum_, 0, count);
            }
            else
            {
                context.Draw(0, vertexNum_);
            }
        }
Пример #2
0
        /// <summary>
        /// 描画
        /// </summary>
        public void Draw(GraphicsContext context)
        {
            context.SetVertexBuffer(0, vertexBuffer_);
            context.SetIndexBuffer(indexBuffer_);

            for (int i = 0; i < nodes_.Length; i++)
            {
                if (nodes_[i].Subsets == null)
                {
                    continue;
                }
                foreach (var s in nodes_[i].Subsets)
                {
                    materials_[s.materialIndex].Setup(context);
                    ShaderManager.SetUniformParams(ref worldMatrix_);

                    context.DrawIndexed(s.startIndex, s.endIndex - s.startIndex);
                }
            }
        }