コード例 #1
0
        public MeshPartRenderData CreateMeshPartData(RawMeshData rawMeshData)
        {
            var data = new MeshPartRenderData();

            int vertCount = rawMeshData.Positions.Length;

            if (vertCount == 0)
            {
                throw new InvalidOperationException();
            }

            data.IndexBuffer  = CreateMeshPartIndexBuffer(rawMeshData.Positions);
            data.VertexBuffer = CreateMeshPartVertexBuffer(rawMeshData.Positions, rawMeshData.Normals, rawMeshData.Texcoords, rawMeshData.Tangents);

            //data.VertexCount = vertCount;
            data.PrimitiveCount = vertCount / 3;

            return(data);
        }
コード例 #2
0
 public MeshElementPart(DeferredMaterial mat, MeshPartRenderData part)
 {
     this.mat  = mat;
     this.part = part;
 }