Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
be25334c
Commit
be25334c
authored
Sep 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timing code
parent
9ebd1676
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
subdivision.cpp
QTProject/subdivision.cpp
+11
-0
No files found.
QTProject/subdivision.cpp
View file @
be25334c
...
@@ -86,6 +86,10 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -86,6 +86,10 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
if
(
input
.
index_irregular_buffer
.
isEmpty
())
{
if
(
input
.
index_irregular_buffer
.
isEmpty
())
{
// current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular);
// current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular);
}
else
{
}
else
{
QTime
timer
;
timer
.
start
();
qCDebug
(
log_timing
)
<<
"subdivide started"
;
Tables
tables
=
precomputeTables
(
input
);
Tables
tables
=
precomputeTables
(
input
);
Result
result
=
runShader
(
input
,
tables
);
Result
result
=
runShader
(
input
,
tables
);
...
@@ -116,6 +120,8 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -116,6 +120,8 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
qCDebug
(
log_subdiv
)
<<
"patches"
<<
patches
.
length
();
qCDebug
(
log_subdiv
)
<<
"patches"
<<
patches
.
length
();
current_mesh
->
update
(
result
.
vb_handle
,
result
.
vertex_buffer
,
result
.
vertex_buffer_irregular
,
irregular_ib
,
patches
);
current_mesh
->
update
(
result
.
vb_handle
,
result
.
vertex_buffer
,
result
.
vertex_buffer_irregular
,
irregular_ib
,
patches
);
qCDebug
(
log_timing
)
<<
"subdivide done:"
<<
formatTimeMeasurement
(
timer
.
elapsed
());
}
}
}
}
...
@@ -1019,6 +1025,10 @@ void Subdivision::runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indic
...
@@ -1019,6 +1025,10 @@ void Subdivision::runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indic
}
}
void
Subdivision
::
updateIrregularForDraw
(
const
QVector
<
Triangle
>
&
triangles
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
,
Result
&
result
){
void
Subdivision
::
updateIrregularForDraw
(
const
QVector
<
Triangle
>
&
triangles
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
,
Result
&
result
){
QTime
timer
;
timer
.
start
();
qCDebug
(
log_timing
)
<<
"updateIrregularForDraw started"
;
result
.
vertex_buffer_irregular
.
resize
(
result
.
vertex_buffer
.
size
());
result
.
vertex_buffer_irregular
.
resize
(
result
.
vertex_buffer
.
size
());
QVectorIterator
<
Triangle
>
it
(
triangles
);
QVectorIterator
<
Triangle
>
it
(
triangles
);
...
@@ -1035,6 +1045,7 @@ void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap
...
@@ -1035,6 +1045,7 @@ void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap
result
.
vertex_buffer_irregular
[
triangle
.
v_idx
()].
pos
=
updateIrregularVertexForDraw
(
triangle
.
v
(),
vertexNeighbors
(
triangle
,
ns
.
vw
,
neighbors
));
result
.
vertex_buffer_irregular
[
triangle
.
v_idx
()].
pos
=
updateIrregularVertexForDraw
(
triangle
.
v
(),
vertexNeighbors
(
triangle
,
ns
.
vw
,
neighbors
));
result
.
vertex_buffer_irregular
[
triangle
.
w_idx
()].
pos
=
updateIrregularVertexForDraw
(
triangle
.
w
(),
vertexNeighbors
(
triangle
,
ns
.
wu
,
neighbors
));
result
.
vertex_buffer_irregular
[
triangle
.
w_idx
()].
pos
=
updateIrregularVertexForDraw
(
triangle
.
w
(),
vertexNeighbors
(
triangle
,
ns
.
wu
,
neighbors
));
}
}
qCDebug
(
log_timing
)
<<
"updateIrregularForDraw done:"
<<
formatTimeMeasurement
(
timer
.
elapsed
());
}
}
bool
Subdivision
::
containsVertex
(
QVector
<
Vertex
>
&
vertices
,
Vertex
vertex
)
{
bool
Subdivision
::
containsVertex
(
QVector
<
Vertex
>
&
vertices
,
Vertex
vertex
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment