Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/assets/shaders/GLSL/vertexAtoms/foliage.vert

Diff revisions: vs.
  @@ -1,26 +1,23 @@
1 1 uniform vec3 scale;
2 2 uniform float grassScale;
3 - uniform float time;
3 + uniform float dvd_time;
4 4 uniform vec2 windDirection;
5 5 uniform float windSpeed;
6 6 uniform float lod_metric;
7 7
8 - float time2 = time * 0.001; //to seconds
9 -
10 8 void computeFoliageMovementTree(inout vec4 vertex) {
11 9
12 - vec4 vertexM = gl_TextureMatrix[0] * dvd_ModelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);
13 - float move_speed = (float(int(vertexM.y*vertexM.z) % 50)/50.0 + 0.5);
14 - float timeTree = time2 * windSpeed * move_speed;
10 + float move_speed = (float(int(_vertexM.y*_vertexM.z) % 50)/50.0 + 0.5);
11 + float timeTree = dvd_time * 0.001 * windSpeed * move_speed; //to seconds
15 12 float amplituted = pow(vertex.y, 2.0);
16 - vertex.x += 0.01 * amplituted * cos(timeTree + vertexM.x) *windDirection.x;
17 - vertex.z += 0.05 *scale.y* amplituted * cos(timeTree + vertexM.z) *windDirection.y; ///wd.y is actually wd.z in code
13 + vertex.x += 0.01 * amplituted * cos(timeTree + _vertexM.x) *windDirection.x;
14 + vertex.z += 0.05 *scale.y* amplituted * cos(timeTree + _vertexM.z) *windDirection.y; ///wd.y is actually wd.z in code
18 15 }
19 16
20 17 void computeFoliageMovementGrass(in vec3 normal, in vec3 normalMV, inout vec4 vertex) {
21 18 if(normal.y > 0.0 ) {
19 + float timeGrass = windSpeed * dvd_time * 0.001; //to seconds
22 20 normalMV = -normalMV;
23 - float timeGrass = time2 * windSpeed;
24 21 float cosX = cos(vertex.x);
25 22 float sinX = sin(vertex.x);
26 23 float halfScale = 0.5*grassScale;