Hey guys, I had the fade in fade out working and not sure why it’s not working anymore. The code was very simple and exactly as it’s mentioned in the wiki, I implemented and it worked, now it doesn’t.
Here’s my code (nothing happens), please advise:
[java]
package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.FadeFilter;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
/**
test
@author normenhansen
*/
public class Main extends SimpleApplication {
private FilterPostProcessor fpp;
private FadeFilter fade;
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
}
/**
function that results in a fade in effect at the beginning of the
I’m trying to do this with a 2D picture but it doesn’t seem to work:( I have two questions: can this work with 2D pictures and if it can, what am I doing wrong
Fade filter (the topic of this thread) fades the whole screen to/from black.
This has nothing to do with fading the alpha of some object and if that’s what you mean then you should start another thread and include more information on what you’ve tried that “isn’t working”, etc.