1
0
forked from 0ad/0ad
0ad/binaries/data/mods/official/shaders/globallight.vs
prefect 7dee30e24c - Terrain self-shadows (only noticeable with a low angle of sun)
- explicitly split ambient and diffuse
- add renderer.shadowZBias to bias depths in the depth texture
  and avoid flickering artifacts caused by Z fighting
- cantabrian_generated uses new light values so that shadows aren't
pitch
  black

This was SVN commit r3508.
2006-02-13 14:18:20 +00:00

12 lines
203 B
GLSL

uniform vec3 ambient;
uniform vec3 sunDir;
uniform vec3 sunColor;
vec3 lighting(vec3 normal)
{
vec3 color = ambient;
float d = max(0.0, -dot(normal, sunDir));
color += d * sunColor;
return color;
}