Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL/oceanGLSL.vert @ 12083

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

Reorganised shader programs

File size: 905 bytes
Line 
1// oceanGLSL.vert
2// vertex program for Ocean water simulation
3// 05 Aug 2005
4// adapted for Ogre by nfz
5// converted from HLSL to GLSL
6// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
7
8// 06 Aug 2005: moved uvw calculation from fragment program into vertex program
9
10uniform vec3 scale;
11uniform vec3 eyePosition;
12uniform vec2 waveSpeed;
13uniform float noiseSpeed;
14uniform float time_0_X;
15uniform mat4 worldViewProj;
16
17varying vec3 uvw;
18varying vec3 normal;
19varying vec3 vVec;
20
21void main(void)
22{
23   gl_Position = worldViewProj * gl_Vertex;
24   
25   //  the view vector needs to be in vertex space
26   vVec = gl_Vertex.xyz - eyePosition;
27   normal = gl_Normal;
28   // uvw is the calculated uvw coordinates based on vertex position
29   uvw = gl_Vertex.xyz * scale.xyz;
30   uvw.xz += waveSpeed * time_0_X;
31   uvw.y += uvw.z + noiseSpeed * time_0_X;
32   
33}
Note: See TracBrowser for help on using the repository browser.