Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/data_extern/programs/GLSL120/oceanGLSL.vert @ 12412

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

Changed folder structure, deletet some unused files and cleaned up code

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
17attribute vec4 vertex;
18attribute vec3 normal;
19
20varying vec3 uvw;
21varying vec3 oNormal;
22varying vec3 vVec;
23
24void main(void)
25{
26   gl_Position = worldViewProj * vertex;
27   
28   //  the view vector needs to be in vertex space
29   vVec = vertex.xyz - eyePosition;
30   oNormal = normal;
31   // uvw is the calculated uvw coordinates based on vertex position
32   uvw = vertex.xyz * scale.xyz;
33   uvw.xz += waveSpeed * time_0_X;
34   uvw.y += uvw.z + noiseSpeed * time_0_X;
35}
Note: See TracBrowser for help on using the repository browser.