summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/effects/extractF.glsl
blob: 713f8021de0c636f800e38fec0d8bacc8fc856b4 (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
/**
 * @file extractF.glsl
 *
 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 * $/LicenseInfo$
 */
 


uniform sampler2DRect RenderTexture;
uniform float extractLow;
uniform float extractHigh;
uniform vec3 lumWeights;

void main(void) 
{
	/// Get scene color
	vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
	
	/// Extract luminance and scale up by night vision brightness
	float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights));

	gl_FragColor = vec4(vec3(lum), 1.0);
}