Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterVp.glsl @ 44

Last change on this file since 44 was 44, checked in by bknecht, 17 years ago

merge from tutorial branche to trunk

File size: 432 bytes
Line 
1uniform mat4 worldViewProj;
2uniform vec4 texelOffsets;
3uniform vec4 depthRange;
4
5varying vec2 depth;
6
7void main()
8{
9        gl_Position = ftransform();
10
11        // fix pixel / texel alignment
12        gl_Position.xy += texelOffsets.zw * gl_Position.w;
13        // linear depth storage
14        // offset / scale range output
15#if LINEAR_RANGE
16        depth.x = (gl_Position.z - depthRange.x) * depthRange.w;
17#else
18        depth.x = gl_Position.z;
19#endif
20        depth.y = gl_Position.w;
21
22
23}
24
Note: See TracBrowser for help on using the repository browser.