Document code, and clean up
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
#define A -1,-1,-1,
|
||||
#define B -1,-1, 1,
|
||||
#define C -1, 1,-1,
|
||||
#define D -1, 1, 1,
|
||||
#define E 1,-1,-1,
|
||||
#define F 1,-1, 1,
|
||||
#define G 1, 1,-1,
|
||||
#define H 1, 1, 1,
|
||||
|
||||
float d_cube[] =
|
||||
{
|
||||
3*3*2*6,
|
||||
|
||||
A C E
|
||||
G E C
|
||||
|
||||
E G F
|
||||
H F G
|
||||
|
||||
F H B
|
||||
D B H
|
||||
|
||||
B D A
|
||||
C A D
|
||||
|
||||
C D G
|
||||
H G D
|
||||
|
||||
E B A
|
||||
B E F
|
||||
};
|
||||
@@ -62,7 +62,12 @@ const char * fs =
|
||||
" vec3 lightPos = vec3(0,0,-15);"
|
||||
" vec3 lightDir = normalize(lightPos - FragPos);"
|
||||
|
||||
" float diffuse = max(dot(Normal, lightDir), 0.0);"
|
||||
/*
|
||||
We use the absoulute value, insted of the traditional "max(...,0.0);"
|
||||
so we can ignore the orientation of the triangles in openGL.
|
||||
*/
|
||||
" float diffuse = abs(dot(Normal, lightDir)); "
|
||||
|
||||
" float ambient = 0.5;"
|
||||
" FragColor = (ambient + diffuse)*color;"
|
||||
"}";
|
||||
|
||||
Reference in New Issue
Block a user