=== modified file 'data/shaders/light-advanced.frag'
@@ -81,14 +81,14 @@
void main(void)
{
- Normal = normalize(Normal);
-
- float Diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * max(dot(Normal, Light),0.0);
-
- float Ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
+ vec3 N = normalize(Normal);
+
+ vec4 Diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * max(dot(N, Light),0.0);
+
+ vec4 Ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
Ambient += gl_LightModel.ambient * gl_FrontMaterial.ambient;
- float Specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(max(dot(Normal,HalfVector),0.0), gl_FrontMaterial.shininess);
+ vec4 Specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * pow(max(dot(Normal,HalfVector),0.0), gl_FrontMaterial.shininess);
- gl_FragColor = Ambient + (Diffuse * vec4(1,0,0,1)) + Specular;
+ gl_FragColor = Ambient + (Diffuse * vec4(0,0,1,1)) + Specular;
}
=== modified file 'data/shaders/light-basic.vert'
@@ -62,11 +62,11 @@
void main(void)
{
- Normal = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 Normal = normalize(gl_NormalMatrix * gl_Normal);
- Light = normalize(gl_LightSource[0].position.xyz);
+ vec3 Light = normalize(gl_LightSource[0].position.xyz);
Diffuse = max(dot(Normal, Light),0.0);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-}
\ No newline at end of file
+}