2016-11-25 11:27:05 +01:00
|
|
|
varying vec3 fNormal;
|
|
|
|
|
|
|
|
vec3 ambientLight = vec3(0.2,0.2,0.2);
|
|
|
|
vec3 directionnalLight = normalize(vec3(10,5,7));
|
|
|
|
vec3 directionnalLightFactor = vec3(0.5,0.5,0.5);
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
|
|
|
vec3 ambientFactor = ambientLight;
|
|
|
|
vec3 lambertFactor = max(vec3(0.0,0.0,0.0), dot(directionnalLight, fNormal) * directionnalLightFactor);
|
|
|
|
|
2016-11-29 15:40:30 +01:00
|
|
|
vec4 texel = texture2D(tex, gl_TexCoord[0].xy);
|
2016-11-25 11:27:05 +01:00
|
|
|
gl_FragColor = vec4(ambientFactor + lambertFactor, 1.0);
|
|
|
|
}
|