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
fec25eca
Commit
fec25eca
authored
8 years ago
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed qInfo() and windows compile errors
parent
2b4f6b1c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
12 deletions
+16
-12
Subdivision.pro
QTProject/Subdivision.pro
+1
-1
mainwidget.cpp
QTProject/mainwidget.cpp
+1
-1
mainwindow.cpp
QTProject/mainwindow.cpp
+5
-5
mesh.cpp
QTProject/mesh.cpp
+4
-0
subdivide.frag
QTProject/subdivide.frag
+1
-1
subdivision.cpp
QTProject/subdivision.cpp
+4
-4
No files found.
QTProject/Subdivision.pro
View file @
fec25eca
...
@@ -33,7 +33,7 @@ HEADERS += mainwindow.h \
...
@@ -33,7 +33,7 @@ HEADERS += mainwindow.h \
subdivision
.
h
\
subdivision
.
h
\
vertex
.
h
\
vertex
.
h
\
triangle
.
h
\
triangle
.
h
\
logcategories
.
cpp
logcategories
.
h
FORMS
+=
FORMS
+=
...
...
This diff is collapsed.
Click to expand it.
QTProject/mainwidget.cpp
View file @
fec25eca
...
@@ -188,7 +188,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
...
@@ -188,7 +188,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
qCritical
()
<<
"Linking shader failed:"
<<
shader
->
log
();
qCritical
()
<<
"Linking shader failed:"
<<
shader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
q
Info
()
<<
"Linking Shader done"
;
q
Debug
()
<<
"Linking Shader done"
;
return
shader
;
return
shader
;
...
...
This diff is collapsed.
Click to expand it.
QTProject/mainwindow.cpp
View file @
fec25eca
...
@@ -34,11 +34,11 @@ MainWindow::MainWindow(QWidget *parent) :
...
@@ -34,11 +34,11 @@ MainWindow::MainWindow(QWidget *parent) :
connect
(
CamHome
,
SIGNAL
(
triggered
()),
cam
,
SLOT
(
home
()));
connect
(
CamHome
,
SIGNAL
(
triggered
()),
cam
,
SLOT
(
home
()));
toolBar
->
addAction
(
CamHome
);
toolBar
->
addAction
(
CamHome
);
debugOutput
=
new
QAction
(
"DebugOutput"
,
this
);
//
debugOutput = new QAction("DebugOutput",this);
debugOutput
->
setCheckable
(
true
);
//
debugOutput->setCheckable(true);
debugOutput
->
setChecked
(
false
);
//
debugOutput->setChecked(false);
connect
(
debugOutput
,
SIGNAL
(
triggered
(
bool
)),
m_centralWidget
,
SLOT
(
setdebugOutput
(
bool
)));
//
connect(debugOutput, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setdebugOutput(bool)));
toolBar
->
addAction
(
debugOutput
);
//
toolBar->addAction(debugOutput);
subdivSlider
=
new
QSlider
(
Qt
::
Horizontal
);
subdivSlider
=
new
QSlider
(
Qt
::
Horizontal
);
subdivSlider
->
setMinimum
(
0
);
subdivSlider
->
setMinimum
(
0
);
...
...
This diff is collapsed.
Click to expand it.
QTProject/mesh.cpp
View file @
fec25eca
...
@@ -21,11 +21,13 @@ void Mesh::SubdivEntry::updateIndices() {
...
@@ -21,11 +21,13 @@ void Mesh::SubdivEntry::updateIndices() {
f
->
glDeleteBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glDeleteBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_irregular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_irregular_handle
);
if
(
indices_irregular
.
size
()
!=
0
)
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_irregular
.
size
(),
&
indices_irregular
[
0
],
GL_STATIC_DRAW
);
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_irregular
.
size
(),
&
indices_irregular
[
0
],
GL_STATIC_DRAW
);
f
->
glDeleteBuffers
(
1
,
&
IB_regular_handle
);
f
->
glDeleteBuffers
(
1
,
&
IB_regular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_regular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_regular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_regular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_regular_handle
);
if
(
indices_regular
.
size
()
!=
0
)
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_regular
.
size
(),
&
indices_regular
[
0
],
GL_STATIC_DRAW
);
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_regular
.
size
(),
&
indices_regular
[
0
],
GL_STATIC_DRAW
);
}
}
...
@@ -55,10 +57,12 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVe
...
@@ -55,10 +57,12 @@ void Mesh::SubdivEntry::init(QOpenGLFunctions_4_3_Core *f, GLuint VB_handle, QVe
f
->
glGenBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_irregular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_irregular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_irregular_handle
);
if
(
indices_irregular
.
size
()
!=
0
)
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_irregular
.
size
(),
&
indices_irregular
[
0
],
GL_STATIC_DRAW
);
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
indices_irregular
.
size
(),
&
indices_irregular
[
0
],
GL_STATIC_DRAW
);
f
->
glGenBuffers
(
1
,
&
IB_regular_handle
);
f
->
glGenBuffers
(
1
,
&
IB_regular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_regular_handle
);
f
->
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
IB_regular_handle
);
if
(
patches
.
size
()
!=
0
)
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
patches
.
size
(),
&
patches
[
0
],
GL_STATIC_DRAW
);
f
->
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
sizeof
(
unsigned
int
)
*
patches
.
size
(),
&
patches
[
0
],
GL_STATIC_DRAW
);
}
}
...
...
This diff is collapsed.
Click to expand it.
QTProject/subdivide.frag
View file @
fec25eca
...
@@ -70,7 +70,7 @@ void main()
...
@@ -70,7 +70,7 @@ void main()
addWireframe
();
addWireframe
();
// color =
materialInfo.Diffuse
;
// color =
vec4(materialInfo.Diffuse,0)
;
// color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0)));
// color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0)));
}
}
This diff is collapsed.
Click to expand it.
QTProject/subdivision.cpp
View file @
fec25eca
...
@@ -22,7 +22,7 @@ void Subdivision::init() {
...
@@ -22,7 +22,7 @@ void Subdivision::init() {
}
}
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
qC
Info
(
log_subdiv
)
<<
"Compiling compute shader ..."
;
qC
Debug
(
log_subdiv
)
<<
"Compiling compute shader ..."
;
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
if
(
!
computeShader
->
compileSourceFile
(
source
)){
if
(
!
computeShader
->
compileSourceFile
(
source
)){
qCCritical
(
log_subdiv
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
qCCritical
(
log_subdiv
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
...
@@ -57,7 +57,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -57,7 +57,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input
input
;
Input
input
;
int
currentMax
=
current_mesh
->
buffers
.
size
()
-
1
;
int
currentMax
=
current_mesh
->
buffers
.
size
()
-
1
;
qC
Info
(
log_subdiv
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
qC
Debug
(
log_subdiv
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
if
(
level
<=
currentMax
)
if
(
level
<=
currentMax
)
return
;
return
;
...
@@ -152,7 +152,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -152,7 +152,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
precomputeVertexTable
(
tables
,
vb
,
ib
);
precomputeVertexTable
(
tables
,
vb
,
ib
);
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
qC
Info
(
log_subdiv
)
<<
"Precompute Tables Done"
;
qC
Debug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
return
tables
;
return
tables
;
}
}
...
@@ -548,7 +548,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
...
@@ -548,7 +548,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
}
}
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
qC
Info
(
log_subdiv
)
<<
"Running compute shader"
;
qC
Debug
(
log_subdiv
)
<<
"Running compute shader"
;
Result
result
;
Result
result
;
...
...
This diff is collapsed.
Click to expand it.
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