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:
847 bytes
|
Line | |
---|
1 | #version 150 |
---|
2 | |
---|
3 | |
---|
4 | uniform mat4 worldViewProj; |
---|
5 | uniform vec4 ambient; |
---|
6 | uniform vec4 offset; |
---|
7 | |
---|
8 | in vec4 position; |
---|
9 | in vec4 normal; |
---|
10 | in vec4 uv0; |
---|
11 | |
---|
12 | out vec4 oUv0; |
---|
13 | out vec4 oColour; |
---|
14 | |
---|
15 | /// grass_vp ambient |
---|
16 | void main() |
---|
17 | { |
---|
18 | // Position |
---|
19 | vec4 mypos = position; |
---|
20 | vec4 factor = vec4(1.0, 1.0, 1.0, 1.0) - uv0.yyyy; |
---|
21 | mypos = mypos + offset * factor; |
---|
22 | gl_Position = worldViewProj * mypos; |
---|
23 | // Texture Coord |
---|
24 | oUv0.xy = uv0.xy; |
---|
25 | /* |
---|
26 | // Normal |
---|
27 | // Make vec from vertex to camera |
---|
28 | vec4 EyeVec = camObjPos - mypos; |
---|
29 | // Dot the v to eye and the normal to see if they point |
---|
30 | // in the same direction or opposite |
---|
31 | float aligned = dot(normal, EyeVec); // -1..1 |
---|
32 | // If aligned is negative, we need to flip the normal |
---|
33 | if (aligned < 0) |
---|
34 | normal = -normal; |
---|
35 | //oNormal = normal; |
---|
36 | */ |
---|
37 | // Color |
---|
38 | oColour = ambient; |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.