Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL120/oceanGLSL.vert @ 12096

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

Updated programs and adjusted Material to work with GLSL>150

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.