Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/DepthShadowmapCasterVp.glsles @ 12091

Last change on this file since 12091 was 12091, checked in by wiesep, 6 years ago

Updated programs and adjusted Material to work with GLSL>150

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