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
ad28fd9c
Commit
ad28fd9c
authored
Aug 17, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix variable names
parent
067556e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
mainwidget.cpp
QTProject/mainwidget.cpp
+22
-13
mainwidget.h
QTProject/mainwidget.h
+1
-1
No files found.
QTProject/mainwidget.cpp
View file @
ad28fd9c
...
@@ -109,14 +109,23 @@ void MainWidget::initializeGL(){
...
@@ -109,14 +109,23 @@ void MainWidget::initializeGL(){
QString
vertSource
=
QLatin1String
(
":/subdivide.vert"
);
QString
vertSource
=
QLatin1String
(
":/subdivide.vert"
);
QString
tesselationControlSource
=
QLatin1String
(
":/subdivide.tcs"
);
QString
tesselationControlSource
=
QLatin1String
(
":/subdivide.tcs"
);
QString
tesselationEvaluationSource
=
QLatin1String
(
":/subdivide.tes"
);
QString
tesselationEvaluationSource
=
QLatin1String
(
":/subdivide.tes"
);
QString
tesselationControlSource
2
=
QLatin1String
(
":/subdivideRegular.tcs"
);
QString
tesselationControlSource
Regular
=
QLatin1String
(
":/subdivideRegular.tcs"
);
QString
tesselationEvaluationSource
2
=
QLatin1String
(
":/subdivideRegular.tes"
);
QString
tesselationEvaluationSource
Regular
=
QLatin1String
(
":/subdivideRegular.tes"
);
QString
geometrySource
=
QLatin1String
(
":/subdivide.geo"
);
QString
geometrySource
=
QLatin1String
(
":/subdivide.geo"
);
QString
fragSource
=
QLatin1String
(
":/subdivide.frag"
);
QString
fragSource
=
QLatin1String
(
":/subdivide.frag"
);
subdevisionShader
=
initShaderProgram
(
vertSource
,
tesselationControlSource
,
tesselationEvaluationSource
,
geometrySource
,
fragSource
);
subdivisionShader
=
initShaderProgram
(
vertSource
,
regularShader
=
initShaderProgram
(
vertSource
,
tesselationControlSource2
,
tesselationEvaluationSource2
,
geometrySource
,
fragSource
);
tesselationControlSource
,
tesselationEvaluationSource
,
geometrySource
,
fragSource
);
regularShader
=
initShaderProgram
(
vertSource
,
tesselationControlSourceRegular
,
tesselationEvaluationSourceRegular
,
geometrySource
,
fragSource
);
subdivision
->
init
();
subdivision
->
init
();
//loadNewMesh( "../Models/demon_head.3ds");
//loadNewMesh( "../Models/demon_head.3ds");
...
@@ -227,27 +236,27 @@ void MainWidget::paintGL(){
...
@@ -227,27 +236,27 @@ void MainWidget::paintGL(){
}
}
subd
e
visionShader
->
bind
();
subd
i
visionShader
->
bind
();
subd
e
visionShader
->
setUniformValue
(
"wireframe"
,
wireframe
);
subd
i
visionShader
->
setUniformValue
(
"wireframe"
,
wireframe
);
subd
e
visionShader
->
setUniformValue
(
"colorTexture"
,
0
);
subd
i
visionShader
->
setUniformValue
(
"colorTexture"
,
0
);
subd
e
visionShader
->
setUniformValue
(
"LightPos"
,
QVector3D
(
0
,
100
,
100
));
subd
i
visionShader
->
setUniformValue
(
"LightPos"
,
QVector3D
(
0
,
100
,
100
));
subd
e
visionShader
->
setUniformValue
(
"subdiv"
,
1
);
subd
i
visionShader
->
setUniformValue
(
"subdiv"
,
1
);
mesh
->
render
(
subd
e
visionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
subdivLevel
,
false
);
mesh
->
render
(
subd
i
visionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
subdivLevel
,
false
);
if
(
subdivLevel
>
0
){
if
(
subdivLevel
>
0
){
glEnable
(
GL_BLEND
);
glEnable
(
GL_BLEND
);
glDepthMask
(
GL_FALSE
);
glDepthMask
(
GL_FALSE
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
subd
e
visionShader
->
setUniformValue
(
"wireframe"
,
false
);
subd
i
visionShader
->
setUniformValue
(
"wireframe"
,
false
);
mesh
->
render
(
subd
e
visionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
0
,
false
);
mesh
->
render
(
subd
i
visionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
0
,
false
);
glDisable
(
GL_BLEND
);
glDisable
(
GL_BLEND
);
glDepthMask
(
GL_TRUE
);
glDepthMask
(
GL_TRUE
);
}
}
subd
e
visionShader
->
release
();
subd
i
visionShader
->
release
();
...
...
QTProject/mainwidget.h
View file @
ad28fd9c
...
@@ -53,7 +53,7 @@ private:
...
@@ -53,7 +53,7 @@ private:
Camera
*
cam
;
Camera
*
cam
;
QOpenGLShaderProgram
*
subd
e
visionShader
;
QOpenGLShaderProgram
*
subd
i
visionShader
;
QOpenGLShaderProgram
*
regularShader
;
QOpenGLShaderProgram
*
regularShader
;
QMatrix4x4
m_projection
;
QMatrix4x4
m_projection
;
QTime
startTime
;
QTime
startTime
;
...
...
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