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
04f00bf9
Commit
04f00bf9
authored
Jul 07, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
box update
normal fix
parent
30ee4452
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
36 deletions
+29
-36
box.obj
Models/box.obj
+21
-34
subdivide.frag
QTProject/subdivide.frag
+1
-1
subdivide.geo
QTProject/subdivide.geo
+6
-0
subdivision-edge.compute
QTProject/subdivision-edge.compute
+1
-1
No files found.
Models/box.obj
View file @
04f00bf9
# Blender v2.57 (sub 0) OBJ File: ''
# www.blender.org
mtllib box.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
...
...
@@ -10,33 +6,24 @@ v 1.000000 1.000000 -1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 2.094305 1.396205
vt 1.396205 2.094305
vt 0.698100 1.396205
vt 1.396205 0.698100
vt 5.000000 5.000000
vt 2.792410 5.000000
vt 2.792410 2.792410
vt 5.000000 2.792410
vt 2.792410 2.094305
vt 2.094305 2.792410
vt 0.698100 2.792410
vt 0.000000 2.094305
vt 0.000000 0.698100
vt 0.698100 0.000000
vt 2.792410 0.698100
vt 2.094305 0.000000
usemtl Material
s off
f 1/1 2/2 3/3
f 1/1 3/3 4/4
f 5/5 8/6 7/7
f 5/5 7/7 6/8
f 1/1 5/9 6/10
f 1/1 6/10 2/2
f 2/2 6/11 7/12
f 2/2 7/12 3/3
f 3/3 7/13 8/14
f 3/3 8/14 4/4
f 5/15 1/1 4/4
f 5/15 4/4 8/16
vn 1 0 0
vn 0 1 0
vn 0 0 1
vn -1 0 0
vn 0 -1 0
vn 0 0 -1
f 1//5 2//5 3//5
f 1//5 3//5 4//5
f 5//2 8//2 7//2
f 5//2 7//2 6//2
f 1//1 5//1 6//1
f 1//1 6//1 2//1
f 2//3 6//3 7//3
f 2//3 7//3 3//3
f 3//4 7//4 8//4
f 3//4 8//4 4//4
f 5//6 1//6 4//6
f 5//6 4//6 8//6
QTProject/subdivide.frag
View file @
04f00bf9
...
...
@@ -42,7 +42,7 @@ vec3 phong(vec3 lightPos){
//return vec3(diffuse );
//return dcolor;
//return (diffuse*dcolor);
return
(
dcolor
*
diffuse
+
materialInfo
.
Specular
*
specular
);
return
(
dcolor
*
diffuse
);
//
+ materialInfo.Specular * specular);
}
...
...
QTProject/subdivide.geo
View file @
04f00bf9
...
...
@@ -22,10 +22,14 @@ void main(void)
// passthrough geometry shader for wireframe rendering
// just addind TriDistance;
vec3 normal = cross(teCamPosition[2]-teCamPosition[0],teCamPosition[1]-teCamPosition[0]);
//normal = cross(teCamPosition[1]-teCamPosition[0],teCamPosition[2]-teCamPosition[0]);
gTriDistance = vec3(1, 0, 0);
gUV = teUV[0];
gCamPosition = teCamPosition[0];
gCamNormal = teCamNormal[0];
//gCamNormal = normal;
gPatchDistance = tePatchDistance[0];
gl_Position = gl_in[0].gl_Position;
EmitVertex();
...
...
@@ -34,6 +38,7 @@ void main(void)
gUV = teUV[1];
gCamPosition = teCamPosition[1];
gCamNormal = teCamNormal[1];
//gCamNormal = normal;
gPatchDistance = tePatchDistance[1];
gl_Position = gl_in[1].gl_Position;
EmitVertex();
...
...
@@ -42,6 +47,7 @@ void main(void)
gUV = teUV[2];
gCamPosition = teCamPosition[2];
gCamNormal = teCamNormal[2];
// gCamNormal = normal;
gPatchDistance = tePatchDistance[2];
gl_Position = gl_in[2].gl_Position;
EmitVertex();
...
...
QTProject/subdivision-edge.compute
View file @
04f00bf9
...
...
@@ -31,5 +31,5 @@ void main(){
vec3 pos;
edges[gl_GlobalInvocationID.x].pos = 3.0f/8.0f * a.pos + 3.0f/8.0f * b.pos + 1.0f/8.0f * c.pos + 1.0f/8.0f * d.pos;
edges[gl_GlobalInvocationID.x].norm = normalize(3.0
/8.0 * (vertices[indices[gl_GlobalInvocationID.x][0]].norm + vertices[indices[gl_GlobalInvocationID.x][1]].norm) + 1.0/8.0 * (vertices[indices[gl_GlobalInvocationID.x][2]].norm + vertices[indices[gl_GlobalInvocationID.y][3]].norm)
);
edges[gl_GlobalInvocationID.x].norm = normalize(3.0
f/8.0f * a.norm + 3.0f/8.0f * b.norm + 1.0f/8.0f * c.norm + 1.0f/8.0f * d.norm
);
}
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