aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
blob: 7ee41998e2b0e08bcb6c3e3a286ec22e54d15a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * @file waterFogF.glsl
 *
 * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

vec4 applyWaterFog(vec4 color)
{
	// GL_EXP2 Fog
	//float fog = exp(-gl_Fog.density * gl_Fog.density * gl_FogFragCoord * gl_FogFragCoord);
	// GL_EXP Fog
	// float fog = exp(-gl_Fog.density * gl_FogFragCoord);
	// GL_LINEAR Fog
	float fog = (gl_Fog.end - gl_FogFragCoord) * gl_Fog.scale;
	fog = clamp(fog, 0.0, 1.0);
	color.rgb = mix(gl_Fog.color.rgb, color.rgb, fog);
	return color;
}