Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/Samples/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl @ 1

Last change on this file since 1 was 1, checked in by landauf, 17 years ago
File size: 1.8 KB
Line 
1/******************************************************************************
2Copyright (c) W.J. van der Laan
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of
5this software  and associated documentation files (the "Software"), to deal in
6the Software without restriction, including without limitation the rights to use,
7copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8Software, and to permit persons to whom the Software is furnished to do so, subject
9to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all copies
12or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE
19SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20******************************************************************************/
21/** Deferred shading framework
22        // W.J. :wumpus: van der Laan 2005 //
23       
24        Material shader: Normal mapped
25*/
26varying vec3 normal;
27varying vec3 tangent_;
28varying vec3 binormal;
29
30varying vec2 texCoord0;
31varying float depth;
32
33attribute vec3 tangent;
34
35void main()                   
36{
37   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
38   
39   gl_Position = projPos;
40   depth = projPos.w;
41   texCoord0 = vec2(gl_MultiTexCoord0);
42   
43   normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
44   tangent_ = vec3(gl_ModelViewMatrix*vec4(tangent,0));
45   binormal = cross(normal, tangent_);
46   
47}
Note: See TracBrowser for help on using the repository browser.