1/**
2 * @file
3 * @brief Fog vertex shader.
4 */
5
6#if r_fog
7uniform float FOGDENSITY;
8uniform vec2 FOGRANGE; /* start, end */
9
10out_qualifier float fog;
11
12/**
13 * @brief FogVertex.
14 */
15void FogVertex(void) {
16	/* Calculate interpolated fog depth.*/
17	float fogT = (gl_Position.z - FOGRANGE[0]) / (FOGRANGE[1] - FOGRANGE[0]);
18	fog = clamp(fogT, 0.0, 1.0) * FOGDENSITY;
19}
20#endif
21