瀏覽代碼

Properly update the Height map and normal map to the water filter material when setting those textures to the filter

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9764 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 13 年之前
父節點
當前提交
e0df200dfd
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      engine/src/core-effects/com/jme3/water/WaterFilter.java

+ 6 - 0
engine/src/core-effects/com/jme3/water/WaterFilter.java

@@ -720,6 +720,9 @@ public class WaterFilter extends Filter {
     public void setHeightTexture(Texture2D heightTexture) {
         this.heightTexture = heightTexture;
         heightTexture.setWrap(WrapMode.Repeat);
+        if (material != null) {
+            material.setTexture("HeightMap", heightTexture);
+        }
     }
 
     /**
@@ -729,6 +732,9 @@ public class WaterFilter extends Filter {
     public void setNormalTexture(Texture2D normalTexture) {
         this.normalTexture = normalTexture;
         normalTexture.setWrap(WrapMode.Repeat);
+        if (material != null) {
+            material.setTexture("NormalMap", normalTexture);
+        }
     }
 
     /**