blob: 6f732ed731c760886395dff9f25aa726eda0fc09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
void applyScatter(inout vec3 color);
uniform sampler2D diffuseMap;
void default_lighting()
{
vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
//applyScatter(color.rgb);
gl_FragColor = color;
}
void alpha_lighting()
{
vec4 diff = texture2D(diffuseMap, gl_TexCoord[0].xy);
vec3 color = gl_Color.rgb * diff.rgb;
applyScatter(color);
gl_FragColor.rgb = color;
gl_FragColor.a = diff.a * gl_Color.a;
}
void water_lighting(inout vec3 diff)
{
diff = (diff*0.9 + gl_Color.rgb*0.1);
applyScatter(diff);
}
void terrain_lighting(inout vec3 color)
{
color.rgb *= gl_Color.rgb;
applyScatter(color);
}
vec4 getLightColor()
{
return gl_Color;
}
|