Commit 9b2e2969 by Philipp Adolf

Add extra vertex buffer to Result

parent 4ae392f5
......@@ -109,11 +109,13 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
QVector<unsigned int> irregular_ib;
trianglesToIB(irregular, irregular_ib);
updateIrregularForDraw(irregular, neighbors, result);
QVector<unsigned int> patches;
getPatchIndexBuffer(regular, neighbors, patches);
qCDebug(log_subdiv) << "patches" << patches.length();
current_mesh->update(result.vb_handle, result.vertex_buffer, result.vertex_buffer, irregular_ib, patches);
current_mesh->update(result.vb_handle, result.vertex_buffer, result.vertex_buffer_irregular, irregular_ib, patches);
}
}
......@@ -1037,3 +1039,7 @@ void Subdivision::runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indic
edgeShader->release();
}
void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap<Triangle, Triangle::Neighbors> &neighbors, Result &result){
result.vertex_buffer_irregular = result.vertex_buffer;
}
......@@ -41,6 +41,7 @@ private:
{
GLuint vb_handle;
QVector<Vertex> vertex_buffer;
QVector<Vertex> vertex_buffer_irregular;
};
struct Patch
......@@ -69,6 +70,7 @@ private:
void runCopyShader(GLuint size, GLuint vb_in, GLuint vb_out);
void runVertexShader(GLuint size, GLuint vb_handle, GLuint vertex_indices_handle, GLuint vertex_offsets_handle, GLuint output_handle, GLuint offset_handle);
void runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indices_handle, GLuint output_handle, GLuint offset_handle);
void updateIrregularForDraw(const QVector<Triangle> &triangles, QMap<Triangle, Triangle::Neighbors> &neighbors, Result &result);
QVector<unsigned int> patchIBToTriangleIB(QVector<unsigned int> ib);
......
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