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
8 years ago
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wireframe update
parent
fec25eca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
mesh.cpp
QTProject/mesh.cpp
+3
-1
subdivide.frag
QTProject/subdivide.frag
+12
-10
No files found.
QTProject/mesh.cpp
View file @
72000d21
...
...
@@ -436,8 +436,10 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
if
(
MaterialIndex
<
materials
.
size
())
{
// 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
(
243.0
,
156.0
,
18.0
)
/
255.0
);
// shader->setUniformValue("materialInfo.Diffuse", QVector/3D(1.0f, 1.0f, 1.0f));
}
else
{
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
materials
[
MaterialIndex
].
Diffuse
);
}
...
...
This diff is collapsed.
Click to expand it.
QTProject/subdivide.frag
View file @
72000d21
...
...
@@ -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
(){
//Wireframe rendering
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
));
if
(
d2
<
0
.
01
){
color
=
vec4
(
0
.
0
,
0
.
0
,
1
.
0
,
ALPHA
);
}
amplify
(
d2
,
vec4
(
0
.
0
,
0
.
0
,
1
.
0
,
ALPHA
),
40
);
float
d
=
min
(
gTriDistance
.
x
,
min
(
gTriDistance
.
y
,
gTriDistance
.
z
));
amplify
(
d
,
vec4
(
0
.
0
,
1
.
0
,
0
.
0
,
ALPHA
),
30
);
}
}
...
...
@@ -70,7 +72,7 @@ void main()
addWireframe
();
// color = vec4(materialInfo.Diffuse,0);
// color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0)));
// color = vec4(materialInfo.Diffuse,0);
// color = normalize(abs(vec3(gCamPosition.x,gCamPosition.y,0.0)));
}
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