Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Updated programs and adjusted Material to work with GLSL>150

File size: 631 bytes
Line 
1#version 100
2
3precision mediump int;
4precision mediump float;
5
6uniform mat4 worldViewProj;
7uniform vec4 offset;
8uniform vec4 texelOffsets;
9
10attribute vec4 position;
11attribute vec4 uv0;
12
13varying vec4 oUv0;
14varying vec2 oDepth;
15
16//////////////////////// GRASS SHADOW CASTER
17// Shadow caster vertex program.
18void main()
19{
20        vec4 mypos = position;
21        vec4 factor = vec4(1.0, 1.0, 1.0, 1.0) - uv0.yyyy;
22        mypos = mypos + offset * factor;
23        gl_Position = worldViewProj * mypos;
24
25        // fix pixel / texel alignment
26        gl_Position.xy += texelOffsets.zw * gl_Position.w;
27   
28        oDepth.x = gl_Position.z;
29        oDepth.y = gl_Position.w;
30 
31        oUv0 = uv0;
32}
Note: See TracBrowser for help on using the repository browser.