projects
/
mandelwow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Draw the cubes using flat shading and fewer vertexes.
[mandelwow.git]
/
shaded.vert
diff --git
a/shaded.vert
b/shaded.vert
index e21f5fcbd6cdf4478054ad5331b1ac80dab69a2b..c7c7fa168cd86dd6d5c75005585cd1c77cf6e2cc 100644
(file)
--- a/
shaded.vert
+++ b/
shaded.vert
@@
-3,7
+3,7
@@
precision lowp float;
in vec3 position;
in vec3 normal;
in vec3 position;
in vec3 normal;
-out vec4 color; // Shaded color
+
flat
out vec4 color; // Shaded color
uniform mat4 model;
uniform mat4 perspview;
uniform mat4 model;
uniform mat4 perspview;
@@
-12,7
+12,7
@@
uniform vec3 col;
void main() {
mat4 m = perspview * model;
vec3 dark = col * 0.1;
void main() {
mat4 m = perspview * model;
vec3 dark = col * 0.1;
- vec3 u_light = vec3(
-
0.5, -0.7, -0.6);
+ vec3 u_light = vec3(
0.5, -0.7, -0.6);
vec3 v_normal = transpose(inverse(mat3(model))) * normal;
float distance = model[3][2];
vec3 v_normal = transpose(inverse(mat3(model))) * normal;
float distance = model[3][2];