This commit is contained in:
Бранимир Караџић 2020-05-30 11:12:10 -07:00
parent be95d12307
commit a5f79320a5
2 changed files with 5 additions and 5 deletions

View File

@ -928,6 +928,6 @@ namespace
ENTRY_IMPLEMENT_MAIN(
ExampleTessellation
, "41-tess"
, "Adaptive Gpu Tessellation."
, "Adaptive GPU Tessellation."
, "https://bkaradzic.github.io/bgfx/examples.html#tess"
);

View File

@ -40,14 +40,14 @@ public:
// It will takes long time if there are too many vertices.
ProgressiveMesh(vertices, stride, (const float *)(vb->data + offset), triangles, (const int *)ib->data, m_map, permutation);
// rearrange the vertex Array
// rearrange the vertex Array
char * temp = (char *)Alloc(vertices * stride);
bx::memCopy(temp, vb->data, vb->size);
for (i = 0; i<vertices; i++) {
bx::memCopy(vb->data + permutation[i] * stride , temp + i * stride, stride);
}
Free(temp);
// update the changes in the entries in the triangle Array
for (i = 0; i<triangles * 3; i++) {
int *indices = (int *)(ib->data + i * sizeof(uint32_t));
@ -145,7 +145,7 @@ public:
m_vb = bgfx::createVertexBuffer(vb, mesh->m_layout);
m_ib = bgfx::createDynamicIndexBuffer(ib, BGFX_BUFFER_INDEX32);
m_numVertices = vertices;
m_numTriangles = indices/3;
m_totalVertices = m_numVertices;
@ -377,6 +377,6 @@ public:
ENTRY_IMPLEMENT_MAIN(
ExampleBunnyLOD
, "42-bunnylod"
, "Bunny LOD"
, "Progressive Mesh LOD"
, "https://bkaradzic.github.io/bgfx/examples.html#bunnylod"
);