fixed editing of color overlay filter

fix-456
javasabr 8 years ago
parent a64594eea9
commit 56fc653725
  1. 6
      jme3-effects/src/main/java/com/jme3/post/filters/ColorOverlayFilter.java

@ -69,8 +69,6 @@ public class ColorOverlayFilter extends Filter {
@Override @Override
protected Material getMaterial() { protected Material getMaterial() {
material.setColor("Color", color);
return material; return material;
} }
@ -88,11 +86,15 @@ public class ColorOverlayFilter extends Filter {
*/ */
public void setColor(ColorRGBA color) { public void setColor(ColorRGBA color) {
this.color = color; this.color = color;
if(material != null) {
material.setColor("Color", color);
}
} }
@Override @Override
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md"); material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md");
material.setColor("Color", color);
} }
@Override @Override

Loading…
Cancel
Save