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
85519081
Commit
85519081
authored
Sep 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow precomputeEdgeTable to return extra triangles
parent
5e6deace
Show 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 @
85519081
...
...
@@ -89,15 +89,18 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Tables
tables
=
precomputeTables
(
input
);
Result
result
=
runShader
(
input
,
tables
);
QVector
<
Triangle
>
triangles
;
ibToTriangles
(
&
result
.
vertex_buffer
,
tables
.
index_buffer
,
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
;
buildNeighborsMap
(
result
.
vertex_buffer
,
all_triangles
,
neighbors
);
QVector
<
Triangle
>
regular
;
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
)
<<
"subdivide: regular"
<<
regular
.
length
();
...
...
@@ -177,6 +180,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
subTimer
.
restart
();
updateIndexBuffer
(
tables
.
index_buffer
,
modified_vertices
);
updateIndexBuffer
(
tables
.
extra_triangles
,
modified_vertices
);
qCDebug
(
log_timing
)
<<
"updateIndexBuffer:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
qCDebug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
...
...
QTProject/subdivision.h
View file @
85519081
...
...
@@ -34,6 +34,7 @@ private:
QVector
<
GLuint
>
vertex_offsets
;
QVector
<
GLuint
>
index_buffer
;
QVector
<
GLuint
>
patch_index_regular
;
QVector
<
GLuint
>
extra_triangles
;
};
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