From 56fc653725dce0addf57a04bca3962963612729e Mon Sep 17 00:00:00 2001 From: javasabr Date: Sun, 22 Jan 2017 09:58:24 +0300 Subject: [PATCH 1/2] fixed editing of color overlay filter --- .../main/java/com/jme3/post/filters/ColorOverlayFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java b/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java index 97a930c85..5c8b9d24b 100644 --- a/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java +++ b/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java @@ -69,8 +69,6 @@ public class ColorOverlayFilter extends Filter { @Override protected Material getMaterial() { - - material.setColor("Color", color); return material; } @@ -88,11 +86,15 @@ public class ColorOverlayFilter extends Filter { */ public void setColor(ColorRGBA color) { this.color = color; + if(material != null) { + material.setColor("Color", color); + } } @Override protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md"); + material.setColor("Color", color); } @Override From e7d95ee734a756007fad82a9c109554b86f60b25 Mon Sep 17 00:00:00 2001 From: javasabr Date: Sun, 22 Jan 2017 09:59:50 +0300 Subject: [PATCH 2/2] to prev --- .../main/java/com/jme3/post/filters/ColorOverlayFilter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java b/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java index 5c8b9d24b..50173c3fc 100644 --- a/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java +++ b/jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java @@ -41,6 +41,7 @@ import com.jme3.math.ColorRGBA; import com.jme3.post.Filter; import com.jme3.renderer.RenderManager; import com.jme3.renderer.ViewPort; + import java.io.IOException; /** @@ -84,9 +85,9 @@ public class ColorOverlayFilter extends Filter { * sets the color * @param color */ - public void setColor(ColorRGBA color) { + public void setColor(final ColorRGBA color) { this.color = color; - if(material != null) { + if (material != null) { material.setColor("Color", color); } }