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
72000d21
Commit
72000d21
authored
Aug 28, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wireframe update
parent
fec25eca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
mesh.cpp
QTProject/mesh.cpp
+3
-1
subdivide.frag
QTProject/subdivide.frag
+11
-9
No files found.
QTProject/mesh.cpp
View file @
72000d21
...
@@ -436,8 +436,10 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
...
@@ -436,8 +436,10 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
if
(
MaterialIndex
<
materials
.
size
())
{
if
(
MaterialIndex
<
materials
.
size
())
{
// qCDebug(log_mesh) << materials[MaterialIndex].Diffuse << materials[MaterialIndex].Specular << materials[MaterialIndex].Shininess << materials[MaterialIndex].hasTexture;
// qCDebug(log_mesh) << materials[MaterialIndex].Diffuse << materials[MaterialIndex].Specular << materials[MaterialIndex].Shininess << materials[MaterialIndex].hasTexture;
if
(
regular
)
{
if
(
regular
)
{
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
QVector3D
(
0.0
f
,
0.0
f
,
1.0
f
));
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
QVector3D
(
0.0
f
,
0.0
f
,
1.0
f
));
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
QVector3D
(
243.0
,
156.0
,
18.0
)
/
255.0
);
// shader->setUniformValue("materialInfo.Diffuse", QVector/3D(1.0f, 1.0f, 1.0f));
}
else
{
}
else
{
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
materials
[
MaterialIndex
].
Diffuse
);
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
materials
[
MaterialIndex
].
Diffuse
);
}
}
...
...
QTProject/subdivide.frag
View file @
72000d21
...
@@ -46,18 +46,20 @@ vec3 phong(vec3 lightPos){
...
@@ -46,18 +46,20 @@ vec3 phong(vec3 lightPos){
}
}
void
amplify
(
float
d
,
vec4
newColor
,
float
scale
){
d
=
scale
*
d
;
d
=
clamp
(
exp2
(
-
2
*
d
*
d
),
0
,
1
);
color
=
newColor
*
d
+
(
1
-
d
)
*
color
;
}
void
addWireframe
(){
void
addWireframe
(){
//Wireframe rendering
//Wireframe rendering
if
(
wireframe
==
true
){
if
(
wireframe
==
true
){
float
d
=
min
(
gTriDistance
.
x
,
min
(
gTriDistance
.
y
,
gTriDistance
.
z
));
if
(
d
<
0
.
02
){
color
=
vec4
(
0
.
0
,
1
.
0
,
0
.
0
,
ALPHA
);
}
float
d2
=
min
(
gPatchDistance
.
x
,
min
(
gPatchDistance
.
y
,
gPatchDistance
.
z
));
float
d2
=
min
(
gPatchDistance
.
x
,
min
(
gPatchDistance
.
y
,
gPatchDistance
.
z
));
if
(
d2
<
0
.
01
){
amplify
(
d2
,
vec4
(
0
.
0
,
0
.
0
,
1
.
0
,
ALPHA
),
40
);
color
=
vec4
(
0
.
0
,
0
.
0
,
1
.
0
,
ALPHA
);
}
float
d
=
min
(
gTriDistance
.
x
,
min
(
gTriDistance
.
y
,
gTriDistance
.
z
));
amplify
(
d
,
vec4
(
0
.
0
,
1
.
0
,
0
.
0
,
ALPHA
),
30
);
}
}
}
}
...
@@ -71,6 +73,6 @@ void main()
...
@@ -71,6 +73,6 @@ void main()
addWireframe
();
addWireframe
();
// color = vec4(materialInfo.Diffuse,0);
// 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)));
}
}
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