blob: cbe00c70b1c6e108aed4fb32e4c5591f897d9fe3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#version 120
varying vec4 passColour;
varying vec3 passNormal;
uniform sampler2D textureIn;
void main() {
vec4 texture = texture2D(textureIn, gl_TexCoord[0].st);
gl_FragColor = texture * passColour;
vec3 fakeSunNormal = normalize(vec3(0.2f,1f,-0.2f));
vec3 normNormal = normalize(passNormal);
float shading = max(0.6f, dot(fakeSunNormal, normNormal));
gl_FragColor = vec4(gl_FragColor.rgb*shading, gl_FragColor.a);//gl_FragColor.rgb*shading
}
|