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