Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/Samples/Media/materials/programs/DepthShadowmapCasterVp.glsl @ 3

Last change on this file since 3 was 3, checked in by anonymous, 17 years ago

=update

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.