Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/Example_FresnelVp.glsles @ 12091

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