 {
   const vec2 wind = foliageIntensFact
     * windStrength
-    * vec2(sin(worldPos.x * 0.05 + time * foliageFreq));
-  const float windS = length(windStrength);
+    * clamp(vec2(smoothTriangleWave(time * foliageFreq)) * 0.4 + 0.6, 0.0, 1.0);
+  const float windS = clamp(length(windStrength), 0.0, 1.0);
 
   applyDetailBending(localPos, worldNormal, worldPos,
     0.0, 0.0, time, intensity, intensity, windS * 5.0, 1.0, 0.1, 

}
// <-

vec2 calcWindStrength(float time)
{
  return max(
    vec2(noise(vec3(time * windStrengthFreq, 0.0, 0.0)),
      noise(vec3(time * windStrengthFreq + 0.5891, 0.0, 0.0)))
      * 2.0 - 1.0,
    vec2(minWindStrength));
}

void applyTreeWind(

  float time,
  vec2 windStrength)
{
  const vec2 detailStrength = clamp(
      vec2(
        noise(vec3(worldPos.x * 2.0 + time * grassFreq, 0.0, 0.0)) * 0.5 + 0.5,
        noise(vec3(worldPos.z * 2.0 + time * grassFreq, 0.0, 0.0)) * 0.5 + 0.5
      )
      , vec2(0.0), vec2(1.0));
  const vec2 mainStrength = clamp(
    vec2(
        (smoothTriangleWave(worldPos.x * 0.05 + time * grassFreq * 0.25) * 0.5 + 0.5) * 0.8 + 0.2,
        (smoothTriangleWave(worldPos.z * 0.05 + time * grassFreq * 0.25) * 0.5 + 0.5) * 0.8 + 0.2
      )
      , vec2(0.0), vec2(1.0));

  const vec2 wind = grassIntensFact
    * windStrength
    * ((mainStrength + detailStrength) * 0.5);

  applyGrassBending(localPos, wind);
} 
