Commit 143894a1 by Philipp Adolf

Just reuse vertices and indices if all regular

parent 182c5e2e
......@@ -71,23 +71,25 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
input.vertex_buffer = entry->vertices;
input.index_buffer = entry->indices;
Tables tables = precomputeTables(input);
Result result = runShader(input, tables);
if (input.index_buffer.isEmpty()) {
current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indicesRegular);
} else {
Tables tables = precomputeTables(input);
Result result = runShader(input, tables);
QVector<unsigned int> regular;
QVector<unsigned int> irregular;
findRegular(tables.index_buffer, result.vertex_buffer, regular, irregular);
QVector<unsigned int> regular;
QVector<unsigned int> irregular;
findRegular(tables.index_buffer, result.vertex_buffer, regular, irregular);
qDebug() << "Indices" << tables.index_buffer.length();
qDebug() << "regular" << regular.length();
qDebug() << "irregular" << irregular.length();
qDebug() << "Indices" << tables.index_buffer.length();
qDebug() << "regular" << regular.length();
qDebug() << "irregular" << irregular.length();
QVector<unsigned int> patches = getPatchIndexBuffer(regular);
qDebug() << "patches" << patches.length();
QVector<unsigned int> patches = getPatchIndexBuffer(regular);
qDebug() << "patches" << patches.length();
current_mesh->update(result.vb_handle, result.vertex_buffer, irregular, patches);
//return new Mesh(f, mesh, result.vertex_buffer, tables.index_buffer);
current_mesh->update(result.vb_handle, result.vertex_buffer, irregular, patches);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment