PageRenderTime 45ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 20ms app.codeStats 0ms

/indra/newview/app_settings/shaders/class2/effects/blurV.glsl

https://bitbucket.org/lindenlab/viewer-beta/
text | 55 lines | 47 code | 8 blank | 0 comment | 0 complexity | 23694dd7f7b27fb3e391147e571ef463 MD5 | raw file
 1/**
 2 * @file blurV.glsl
 3 *
 4 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 5 * Second Life Viewer Source Code
 6 * Copyright (C) 2007, Linden Research, Inc.
 7 * 
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation;
11 * version 2.1 of the License only.
12 * 
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 * Lesser General Public License for more details.
17 * 
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 * 
22 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
23 * $/LicenseInfo$
24 */
25 
26
27
28uniform vec2 texelSize;
29uniform vec2 blurDirection;
30uniform float blurWidth;
31
32void main(void)
33{
34	// Transform vertex
35	gl_Position = ftransform();
36	
37	vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth);
38	vec2 s = gl_MultiTexCoord0.st - (blurDelta * 3.0);
39	
40	// for (int i = 0; i < 7; i++) {
41		// gl_TexCoord[i].st = s + (i * blurDelta);
42	// }
43
44	// MANUALLY UNROLL
45	gl_TexCoord[0].st = s;
46	gl_TexCoord[1].st = s + blurDelta;
47	gl_TexCoord[2].st = s + (2. * blurDelta);
48	gl_TexCoord[3].st = s + (3. * blurDelta);
49	gl_TexCoord[4].st = s + (4. * blurDelta);
50	gl_TexCoord[5].st = s + (5. * blurDelta);
51	gl_TexCoord[6].st = s + (6. * blurDelta);
52
53	// gl_TexCoord[0].st = s;
54	// gl_TexCoord[1].st = blurDelta;
55}