Commit 72c43a22 by Philipp Adolf

Write new vertices at the end of the buffer

parent 42afcc51
......@@ -317,13 +317,14 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, Input &inpu
QVector<QVector<unsigned int> > duplicates;//for debugging
QVector<unsigned int> ib_combined = input.index_irregular_buffer + input.index_regular_buffer;
unsigned int offset = 0;
unsigned int output_offset = input.vertex_buffer.size() + tables.edge_indices.size() / 4;
for (int i = 0; i < input.vertex_buffer.length(); i++){
//hat evtl viel redundanz
QVector<Vertex> adj_v;//helfer
tables.vertex_offsets.push_back(offset);
tables.vertex_indices.push_back(i);
modified_vertices.insert(i, i);
modified_vertices.insert(i, output_offset + i);
offset++;
Vertex originalVertex = input.vertex_buffer[i];
......@@ -745,7 +746,7 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
runEdgeShader(tables.edge_indices.size() / 4, input.vb_handle, edge_indices_handle, output_handle, edge_offset);
int edgeTime = timer.elapsed();
timer.restart();
int vertex_offset = 0;
int vertex_offset = edge_offset + tables.edge_indices.size() / 4;
runVertexShader(input.vertex_buffer.size(), input.vb_handle, vertex_indices_handle, vertex_offsets_handle, output_handle, vertex_offset);
int vertexTime = timer.elapsed();
......
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