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 | |
---|
3 | precision mediump int; |
---|
4 | precision mediump float; |
---|
5 | |
---|
6 | uniform mat4 worldViewProj; |
---|
7 | uniform vec4 offset; |
---|
8 | uniform vec4 texelOffsets; |
---|
9 | |
---|
10 | attribute vec4 position; |
---|
11 | attribute vec4 uv0; |
---|
12 | |
---|
13 | varying vec4 oUv0; |
---|
14 | varying vec2 oDepth; |
---|
15 | |
---|
16 | //////////////////////// GRASS SHADOW CASTER |
---|
17 | // Shadow caster vertex program. |
---|
18 | void 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.