Last change
on this file since 12319 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
1.0 KB
|
Line | |
---|
1 | #version 120 |
---|
2 | |
---|
3 | attribute vec4 uv0; |
---|
4 | attribute vec4 position; |
---|
5 | attribute vec3 normal; |
---|
6 | |
---|
7 | uniform mat4 worldViewProjMatrix; |
---|
8 | uniform vec3 eyePosition; // object space |
---|
9 | uniform float timeVal; |
---|
10 | uniform float scale; // the amount to scale the noise texture by |
---|
11 | uniform float scroll; // the amount by which to scroll the noise |
---|
12 | uniform float noise; // the noise perturb as a factor of the time |
---|
13 | |
---|
14 | varying vec3 noiseCoord; |
---|
15 | varying vec4 projectionCoord; |
---|
16 | varying vec3 eyeDir; |
---|
17 | varying vec3 oNormal; |
---|
18 | |
---|
19 | // Vertex program for fresnel reflections / refractions |
---|
20 | void main() |
---|
21 | { |
---|
22 | gl_Position = worldViewProjMatrix * position; |
---|
23 | // Projective texture coordinates, adjust for mapping |
---|
24 | mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, |
---|
25 | 0.0, -0.5, 0.0, 0.0, |
---|
26 | 0.0, 0.0, 0.5, 0.0, |
---|
27 | 0.5, 0.5, 0.5, 1.0); |
---|
28 | projectionCoord = scalemat * gl_Position; |
---|
29 | |
---|
30 | // Noise map coords |
---|
31 | noiseCoord.xy = (uv0.xy + (timeVal * scroll)) * scale; |
---|
32 | noiseCoord.z = noise * timeVal; |
---|
33 | |
---|
34 | eyeDir = normalize(position.xyz - eyePosition); |
---|
35 | oNormal = normal.rgb; |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.