Jelajahi Sumber

Update Vegetation.glsl

Lisandro Bruzzo 8 tahun lalu
induk
melakukan
a42a299877
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      bin/CoreData/Shaders/GLSL/Vegetation.glsl

+ 1 - 2
bin/CoreData/Shaders/GLSL/Vegetation.glsl

@@ -48,9 +48,8 @@ void VS()
 {
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
-    float height = worldPos.y - modelMatrix[1][3];
 
-    float windStrength = max(height - cWindHeightPivot, 0.0) * cWindHeightFactor;
+    float windStrength = max(iPos.y - cWindHeightPivot, 0.0) * cWindHeightFactor;
     float windPeriod = cElapsedTime * cWindPeriod + dot(worldPos.xz, cWindWorldSpacing);
     worldPos.x += windStrength * sin(windPeriod);
     worldPos.z -= windStrength * cos(windPeriod);