Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Reorganised shader programs

File size: 930 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
10#version 150
11
12uniform vec3 scale;
13uniform vec3 eyePosition;
14uniform vec2 waveSpeed;
15uniform float noiseSpeed;
16uniform float time_0_X;
17uniform mat4 worldViewProj;
18
19in vec4 vertex;
20in vec4 normal;
21
22out vec3 uvw;
23out vec4 oNormal;
24out vec3 vVec;
25
26void main(void)
27{
28   gl_Position = worldViewProj * vertex;
29   
30   //  the view vector needs to be in vertex space
31   vVec = vertex.xyz - eyePosition;
32   oNormal = normal;
33   // uvw is the calculated uvw coordinates based on vertex position
34   uvw = vertex.xyz * scale.xyz;
35   uvw.xz += waveSpeed * time_0_X;
36   uvw.y += uvw.z + noiseSpeed * time_0_X;
37}
Note: See TracBrowser for help on using the repository browser.