Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/Example_FresnelVp.glsl @ 12091

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

Reorganised shader programs

File size: 1.0 KB
Line 
1#version 150
2
3in vec4 uv0;
4in vec4 position;
5in vec3 normal;
6
7uniform mat4 worldViewProjMatrix;
8uniform vec3 eyePosition; // object space
9uniform float timeVal;
10uniform float scale;  // the amount to scale the noise texture by
11uniform float scroll; // the amount by which to scroll the noise
12uniform float noise;  // the noise perturb as a factor of the time
13
14out vec3 noiseCoord;
15out vec4 projectionCoord;
16out vec3 eyeDir;
17out vec3 oNormal;
18
19// Vertex program for fresnel reflections / refractions
20void 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.