Permalink
Browse files

BUG: Image Shutter between black, white, and appropriate

  • Loading branch information...
1 parent 31ef2e6 commit eb4d822fc72d97d03b8269f2508d5d53897ace97 Fabián Heredia Montiel committed Apr 25, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 shaders/vertex.glsl
View
@@ -1,5 +1,11 @@
void main()
{
- vec3 normalCara = normalize(gl_NormalMatrix * gl_Normal)
- gl_Position = ftransform();
+ // Componente Diffuso = Md * Ld * cos(theta)
+ vec3 nC = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 pL = vec3(gl_LightSource[0].position);
+ vec4 eCL= dot(nC, normalize(pL));
+ vec4 cD = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * eCL;
+
+ gl_FrontColor = cD;
+ gl_Position = ftransform();
}

0 comments on commit eb4d822

Please sign in to comment.