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
429de903
Commit
429de903
authored
Jul 21, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for deleting bug
parent
61f40d18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
10 deletions
+29
-10
mainwidget.cpp
QTProject/mainwidget.cpp
+17
-2
mesh.cpp
QTProject/mesh.cpp
+5
-4
subdivide.frag
QTProject/subdivide.frag
+7
-4
No files found.
QTProject/mainwidget.cpp
View file @
429de903
...
...
@@ -220,10 +220,25 @@ void MainWidget::paintGL(){
mesh
->
render
(
subdevisionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
subdivLevel
,
false
);
//glEnable (GL_BLEND);
//glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if
(
subdivLevel
>
0
){
glEnable
(
GL_BLEND
);
glDepthMask
(
GL_FALSE
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
subdevisionShader
->
setUniformValue
(
"wireframe"
,
false
);
mesh
->
render
(
subdevisionShader
,
cam
->
getMatrix
()
*
rot
,
m_projection
,
0
,
false
);
glDisable
(
GL_BLEND
);
glDepthMask
(
GL_TRUE
);
}
subdevisionShader
->
release
();
update
();
}
...
...
QTProject/mesh.cpp
View file @
429de903
...
...
@@ -15,11 +15,11 @@ Mesh::SubdivEntry::SubdivEntry()
Mesh
::
SubdivEntry
::~
SubdivEntry
()
{
f
->
glDeleteBuffers
(
1
,
&
VB_handle
);
qDebug
()
<<
"FIXME: Delete Called: num vertex:"
<<
vertices
.
size
();
/*
f->glDeleteBuffers(1, &VB_handle);
f->glDeleteBuffers(1, &IB_handle);
f->glDeleteBuffers(1, &IB_Regular);
*/
}
...
...
@@ -103,7 +103,8 @@ void Mesh::MeshEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Vertice
void
Mesh
::
MeshEntry
::
update
(
GLuint
VB
,
QVector
<
Vertex
>&
Vertices
,
QVector
<
unsigned
int
>&
Indices
){
buffers
.
resize
(
buffers
.
size
()
+
1
);
buffers
[
buffers
.
size
()
-
1
].
init
(
f
,
VB
,
Vertices
,
Indices
);
SubdivEntry
*
entry
=
&
buffers
[
buffers
.
size
()
-
1
];
entry
->
init
(
f
,
VB
,
Vertices
,
Indices
);
}
Mesh
::
MeshEntry
::~
MeshEntry
()
...
...
QTProject/subdivide.frag
View file @
429de903
#version 430
layout
(
location
=
0
)
out
vec3
color
;
#define ALPHA 0.15
layout
(
location
=
0
)
out
vec4
color
;
in
vec3
gCamPosition
;
in
vec3
gCamNormal
;
...
...
@@ -48,12 +51,12 @@ void addWireframe(){
if
(
wireframe
==
true
){
float
d
=
min
(
gTriDistance
.
x
,
min
(
gTriDistance
.
y
,
gTriDistance
.
z
));
if
(
d
<
0
.
02
){
color
=
vec
3
(
0
.
0
,
1
.
0
,
0
.
0
);
color
=
vec
4
(
0
.
0
,
1
.
0
,
0
.
0
,
ALPHA
);
}
float
d2
=
min
(
gPatchDistance
.
x
,
min
(
gPatchDistance
.
y
,
gPatchDistance
.
z
));
if
(
d2
<
0
.
01
){
color
=
vec
3
(
0
.
0
,
0
.
0
,
1
.
0
);
color
=
vec
4
(
0
.
0
,
0
.
0
,
1
.
0
,
ALPHA
);
}
}
}
...
...
@@ -62,7 +65,7 @@ void addWireframe(){
void
main
()
{
color
=
phong
(
LightPos
);
color
=
vec4
(
phong
(
LightPos
),
ALPHA
);
//color = abs(normalize(gCamNormal));
addWireframe
();
...
...
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