use of com.jme3.post.filters.FadeFilter in project jmonkeyengine by jMonkeyEngine.
the class TestCinematic method createScene.
private void createScene() {
model = (Spatial) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
model.center();
model.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(model);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Cyan);
teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
teapot.setLocalTranslation(10, 0, 10);
teapot.setMaterial(mat);
teapot.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(teapot);
Material matSoil = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
matSoil.setBoolean("UseMaterialColors", true);
matSoil.setColor("Ambient", ColorRGBA.Gray);
matSoil.setColor("Diffuse", ColorRGBA.Green);
matSoil.setColor("Specular", ColorRGBA.Black);
Geometry soil = new Geometry("soil", new Box(50, 1, 50));
soil.setLocalTranslation(0, -6, 0);
soil.setMaterial(matSoil);
soil.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(soil);
DirectionalLight light = new DirectionalLight();
light.setDirection(new Vector3f(0, -1, -1).normalizeLocal());
light.setColor(ColorRGBA.White.mult(1.5f));
rootNode.addLight(light);
fpp = new FilterPostProcessor(assetManager);
fade = new FadeFilter();
fpp.addFilter(fade);
if (renderer.getCaps().contains(Caps.GLSL100)) {
PssmShadowRenderer pssm = new PssmShadowRenderer(assetManager, 512, 1);
pssm.setDirection(new Vector3f(0, -1, -1).normalizeLocal());
pssm.setShadowIntensity(0.4f);
viewPort.addProcessor(pssm);
viewPort.addProcessor(fpp);
}
}
use of com.jme3.post.filters.FadeFilter in project jmonkeyengine by jMonkeyEngine.
the class TestPostFilters method setupFilters.
public void setupFilters() {
if (renderer.getCaps().contains(Caps.GLSL100)) {
fpp = new FilterPostProcessor(assetManager);
// fpp.setNumSamples(4);
// fpp.setNumSamples(4);
//fpp.addFilter(new ColorOverlayFilter(ColorRGBA.LightGray));
fpp.addFilter(new RadialBlurFilter());
fade = new FadeFilter(1.0f);
fpp.addFilter(fade);
viewPort.addProcessor(fpp);
}
}
Aggregations