Commit 1884395d by Philipp Adolf

Pass edgeIndices from precomputeTables to runShader

parent be6417c0
......@@ -47,12 +47,13 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(){
}
Mesh *Subdivision::subdivide(Mesh *mesh) {
precomputeTables(mesh);
runShader(mesh);
QVector<QVector<unsigned int> > edgeIndices;
precomputeTables(mesh, edgeIndices);
runShader(mesh, edgeIndices);
return NULL;
}
void Subdivision::precomputeTables(Mesh *mesh) {
void Subdivision::precomputeTables(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices_base) {
Mesh::Node root = mesh->getRootNode();
int firstMeshEntryIndex = -1;
......@@ -73,7 +74,6 @@ void Subdivision::precomputeTables(Mesh *mesh) {
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
QVector<QVector<unsigned int> > edgeIndices_base;
for (int i = 0; i < ib.length(); i+=3){
//schaue alle dreiecke an
......@@ -265,7 +265,7 @@ void Subdivision::precomputeTables(Mesh *mesh) {
}
void Subdivision::runShader(Mesh *mesh) {
void Subdivision::runShader(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices) {
/*
* This shader will set the output buffer to its global ID times hundred + the local id + offset.
*
......
......@@ -20,8 +20,8 @@ private:
QOpenGLShaderProgram *shader;
QOpenGLShaderProgram *initComputeShaderProgram();
void precomputeTables(Mesh *mesh);
void runShader(Mesh *mesh);
void precomputeTables(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices_base);
void runShader(Mesh *mesh, QVector<QVector<unsigned int> > &edgeIndices);
QVector<unsigned int> fillVector(unsigned int a, unsigned int b, unsigned int c,unsigned int d);
};
......
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