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
d2a58635
Commit
d2a58635
authored
Sep 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow precomputeEdgeTable to return extra triangles
parent
0415637a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
subdivision.cpp
QTProject/subdivision.cpp
+6
-2
subdivision.h
QTProject/subdivision.h
+1
-0
No files found.
QTProject/subdivision.cpp
View file @
d2a58635
...
@@ -89,15 +89,18 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -89,15 +89,18 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Tables
tables
=
precomputeTables
(
input
);
Tables
tables
=
precomputeTables
(
input
);
Result
result
=
runShader
(
input
,
tables
);
Result
result
=
runShader
(
input
,
tables
);
QVector
<
Triangle
>
triangles
;
ibToTriangles
(
&
result
.
vertex_buffer
,
tables
.
index_buffer
,
triangles
);
QVector
<
Triangle
>
all_triangles
;
QVector
<
Triangle
>
all_triangles
;
ibToTriangles
(
&
result
.
vertex_buffer
,
tables
.
index_buffer
,
all_triangles
);
ibToTriangles
(
&
result
.
vertex_buffer
,
tables
.
extra_triangles
,
all_triangles
);
all_triangles
+=
triangles
;
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
;
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
;
buildNeighborsMap
(
result
.
vertex_buffer
,
all_triangles
,
neighbors
);
buildNeighborsMap
(
result
.
vertex_buffer
,
all_triangles
,
neighbors
);
QVector
<
Triangle
>
regular
;
QVector
<
Triangle
>
regular
;
QVector
<
Triangle
>
irregular
;
QVector
<
Triangle
>
irregular
;
findRegular
(
all_
triangles
,
neighbors
,
regular
,
irregular
);
findRegular
(
triangles
,
neighbors
,
regular
,
irregular
);
qCDebug
(
log_subdiv
)
<<
"Indices"
<<
tables
.
index_buffer
.
length
();
qCDebug
(
log_subdiv
)
<<
"Indices"
<<
tables
.
index_buffer
.
length
();
qCDebug
(
log_subdiv
)
<<
"subdivide: regular"
<<
regular
.
length
();
qCDebug
(
log_subdiv
)
<<
"subdivide: regular"
<<
regular
.
length
();
...
@@ -177,6 +180,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -177,6 +180,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
subTimer
.
restart
();
subTimer
.
restart
();
updateIndexBuffer
(
tables
.
index_buffer
,
modified_vertices
);
updateIndexBuffer
(
tables
.
index_buffer
,
modified_vertices
);
updateIndexBuffer
(
tables
.
extra_triangles
,
modified_vertices
);
qCDebug
(
log_timing
)
<<
"updateIndexBuffer:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"updateIndexBuffer:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
qCDebug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
qCDebug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
...
...
QTProject/subdivision.h
View file @
d2a58635
...
@@ -34,6 +34,7 @@ private:
...
@@ -34,6 +34,7 @@ private:
QVector
<
GLuint
>
vertex_offsets
;
QVector
<
GLuint
>
vertex_offsets
;
QVector
<
GLuint
>
index_buffer
;
QVector
<
GLuint
>
index_buffer
;
QVector
<
GLuint
>
patch_index_regular
;
QVector
<
GLuint
>
patch_index_regular
;
QVector
<
GLuint
>
extra_triangles
;
};
};
struct
Result
struct
Result
...
...
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