PageRenderTime 2ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl

https://bitbucket.org/lindenlab/viewer-beta/
Unknown | 50 lines | 42 code | 8 blank | 0 comment | 0 complexity | 1f55f680907db6103b2a116d5f404de9 MD5 | raw file
 1/** 
 2 * @file attachmentShadowV.glsl
 3 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 4 * Second Life Viewer Source Code
 5 * Copyright (C) 2007, Linden Research, Inc.
 6 * 
 7 * This library is free software; you can redistribute it and/or
 8 * modify it under the terms of the GNU Lesser General Public
 9 * License as published by the Free Software Foundation;
10 * version 2.1 of the License only.
11 * 
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 * 
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 * 
21 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
22 * $/LicenseInfo$
23 */
24
25uniform mat4 projection_matrix;
26uniform mat4 modelview_matrix;
27uniform mat4 texture_matrix0;
28
29ATTRIBUTE vec3 position;
30ATTRIBUTE vec4 diffuse_color;
31ATTRIBUTE vec2 texcoord0;
32
33VARYING vec4 vertex_color;
34
35mat4 getObjectSkinnedTransform();
36
37void main()
38{
39	//transform vertex
40	mat4 mat = getObjectSkinnedTransform();
41	
42	mat = modelview_matrix * mat;
43	vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
44	
45	vertex_color = diffuse_color;
46	
47	vec4 p = projection_matrix * vec4(pos, 1.0);
48	p.z = max(p.z, -p.w+0.01);
49	gl_Position = p;
50}