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
1884395d
Commit
1884395d
authored
Jun 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass edgeIndices from precomputeTables to runShader
parent
be6417c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
subdivision.cpp
QTProject/subdivision.cpp
+5
-5
subdivision.h
QTProject/subdivision.h
+2
-2
No files found.
QTProject/subdivision.cpp
View file @
1884395d
...
@@ -47,12 +47,13 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(){
...
@@ -47,12 +47,13 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(){
}
}
Mesh
*
Subdivision
::
subdivide
(
Mesh
*
mesh
)
{
Mesh
*
Subdivision
::
subdivide
(
Mesh
*
mesh
)
{
precomputeTables
(
mesh
);
QVector
<
QVector
<
unsigned
int
>
>
edgeIndices
;
runShader
(
mesh
);
precomputeTables
(
mesh
,
edgeIndices
);
runShader
(
mesh
,
edgeIndices
);
return
NULL
;
return
NULL
;
}
}
void
Subdivision
::
precomputeTables
(
Mesh
*
mesh
)
{
void
Subdivision
::
precomputeTables
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices_base
)
{
Mesh
::
Node
root
=
mesh
->
getRootNode
();
Mesh
::
Node
root
=
mesh
->
getRootNode
();
int
firstMeshEntryIndex
=
-
1
;
int
firstMeshEntryIndex
=
-
1
;
...
@@ -73,7 +74,6 @@ void Subdivision::precomputeTables(Mesh *mesh) {
...
@@ -73,7 +74,6 @@ void Subdivision::precomputeTables(Mesh *mesh) {
//compute edge table
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
//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
){
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
){
//schaue alle dreiecke an
//schaue alle dreiecke an
...
@@ -265,7 +265,7 @@ void Subdivision::precomputeTables(Mesh *mesh) {
...
@@ -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.
* This shader will set the output buffer to its global ID times hundred + the local id + offset.
*
*
...
...
QTProject/subdivision.h
View file @
1884395d
...
@@ -20,8 +20,8 @@ private:
...
@@ -20,8 +20,8 @@ private:
QOpenGLShaderProgram
*
shader
;
QOpenGLShaderProgram
*
shader
;
QOpenGLShaderProgram
*
initComputeShaderProgram
();
QOpenGLShaderProgram
*
initComputeShaderProgram
();
void
precomputeTables
(
Mesh
*
mesh
);
void
precomputeTables
(
Mesh
*
mesh
,
QVector
<
QVector
<
unsigned
int
>
>
&
edgeIndices_base
);
void
runShader
(
Mesh
*
mesh
);
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
);
QVector
<
unsigned
int
>
fillVector
(
unsigned
int
a
,
unsigned
int
b
,
unsigned
int
c
,
unsigned
int
d
);
};
};
...
...
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