This commit is contained in:
Thomas FORGIONE 2016-11-30 11:10:08 +01:00
parent 8d31b13da7
commit d58cabe658
No known key found for this signature in database
GPG Key ID: 2A210FFC062E00C3
2 changed files with 4 additions and 3 deletions

View File

@ -10,11 +10,10 @@ void main() {
vec3 ambientFactor = ambientLight;
vec3 lambertFactor = max(vec3(0.0,0.0,0.0), dot(directionnalLight, fNormal) * directionnalLightFactor);
vec4 texel = texture2D(tex, gl_TexCoord[0].xy);
vec4 noTexColor = vec4(ambientFactor + lambertFactor, 1.0);
vec4 color = texture2D(tex,gl_TexCoord[0].st);
vec4 color = texture2D(tex, gl_TexCoord[0].st);
vec4 fragColor = noTexColor * color;
gl_FragColor = fragColor;

View File

@ -2,7 +2,9 @@ varying vec3 fNormal;
varying vec4 fTexCoord;
void main() {
fNormal = gl_Normal;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}