@@ -11,9 +11,9 @@ uniform float RestLengthVert;
11
11
uniform float RestLengthDiag;
12
12
uniform float DeltaT = 0.000005 ;
13
13
uniform float DampingConst = 0.1 ;
14
- uniform bool HasWind = true ;
15
- uniform float WindStrength = 2 ;
16
- uniform vec3 WindDir = vec3 (4 , 0 , 2 );
14
+ uniform float HasWind = 1.0 ;
15
+ uniform float WindStrength = 3 ;
16
+ uniform vec3 WindDir = vec3 (0.6 , 0 , 0.3 );
17
17
18
18
layout (std430, binding= 0 ) buffer PosIn {
19
19
vec4 PositionIn[];
@@ -27,9 +27,6 @@ layout(std430, binding=2) buffer VelIn {
27
27
layout (std430, binding= 3 ) buffer VelOut {
28
28
vec4 VelocityOut[];
29
29
};
30
- layout (std430, binding= 4 ) buffer NormIn {
31
- vec4 Normal[];
32
- };
33
30
34
31
void main() {
35
32
uvec3 nParticles = gl_NumWorkGroups * gl_WorkGroupSize;
@@ -86,18 +83,7 @@ void main() {
86
83
}
87
84
88
85
force += - DampingConst * v;
89
-
90
- if (HasWind)
91
- {
92
- vec3 normalized_wind_dir;
93
- if (WindDir == vec3 (0 .0f, 0 .0f, 0 .0f))
94
- normalized_wind_dir = glm:: vec3 (0 .0f, 0 .0f, 0 .0f);
95
- else
96
- normalized_wind_dir = normalize (WindDir);
97
-
98
- vec3 f_wind = WindStrength * dot (Normal[idx].xyz, normalized_wind_dir) * Normal[idx].xyz;
99
- force += f_wind;
100
- }
86
+ force += WindStrength * WindDir * HasWind;
101
87
102
88
// Apply simple Euler integrator
103
89
vec3 a = force * ParticleInvMass;
0 commit comments