use of com.jme3.post.ssao.SSAOFilter in project jmonkeyengine by jMonkeyEngine.
the class FilterUtil method cloneSSAOFilter.
public static SSAOFilter cloneSSAOFilter(SSAOFilter filter) {
SSAOFilter clone = new SSAOFilter();
clone.setSampleRadius(filter.getSampleRadius());
clone.setIntensity(filter.getIntensity());
clone.setScale(filter.getScale());
clone.setBias(filter.getBias());
return clone;
}
use of com.jme3.post.ssao.SSAOFilter in project chordatlas by twak.
the class Tweed method simpleInitApp.
public void simpleInitApp() {
// TweedSettings.load( new File ( Tweed.DATA ) );
point = new PointLight();
point.setEnabled(true);
point.setColor(ColorRGBA.White.mult(4));
point.setRadius(50);
rootNode.addLight(point);
sun = new DirectionalLight();
// sun.setDirection(new Vector3f(-0.0f, -1f, -0f).normalizeLocal());
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
sun.setColor(new ColorRGBA(1f, 0.95f, 0.99f, 1f));
rootNode.addLight(sun);
// enable multiple lights
renderManager.setPreferredLightMode(LightMode.SinglePass);
renderManager.setSinglePassLightBatchSize(16);
ambient = new AmbientLight();
rootNode.addLight(ambient);
setAmbient(0);
setDisplayFps(false);
setDisplayStatView(false);
clearBackground();
buildBackground();
getFlyByCamera().setDragToRotate(true);
setTool(tools[0]);
debug = new Node("dbg");
rootNode.attachChild(debug);
// String folder = ; // data-source
// SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
// shadows.setLight(sun);
// shadows.setShadowIntensity(0.3f);
// shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
// viewPort.addProcessor(shadows);
cam.setLocation(TweedSettings.settings.cameraLocation);
cam.setRotation(TweedSettings.settings.cameraOrientation);
setFov(0);
setCameraSpeed(0);
if (false) {
// TweedSettings.settings.SSAO ) {
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter filter = new SSAOFilter(0.50997847f, 1.440001f, 1.39999998f, 0);
// fpp.addFilter( new ColorOverlayFilter( ColorRGBA.Magenta ));
fpp.addFilter(filter);
fpp.addFilter(new FXAAFilter());
viewPort.addProcessor(fpp);
}
TweedSettings.loadDefault();
inputManager.addMapping(MOUSE_MOVE, new MouseAxisTrigger(MouseInput.AXIS_X, false));
inputManager.addMapping(MOUSE_MOVE, new MouseAxisTrigger(MouseInput.AXIS_Y, false));
inputManager.addMapping(MOUSE_MOVE, new MouseAxisTrigger(MouseInput.AXIS_X, true));
inputManager.addMapping(MOUSE_MOVE, new MouseAxisTrigger(MouseInput.AXIS_Y, true));
inputManager.addListener(moveListener, MOUSE_MOVE);
inputManager.addMapping(CLICK, new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(analogListener, CLICK);
inputManager.addMapping(SPEED_UP, new KeyTrigger(KeyInput.KEY_UP));
inputManager.addMapping(SPEED_DOWN, new KeyTrigger(KeyInput.KEY_DOWN));
inputManager.addMapping(AMBIENT_UP, new KeyTrigger(KeyInput.KEY_RIGHT));
inputManager.addMapping(AMBIENT_DOWN, new KeyTrigger(KeyInput.KEY_LEFT));
inputManager.addMapping(FOV_UP, new KeyTrigger(KeyInput.KEY_PGUP));
inputManager.addMapping(FOV_DOWN, new KeyTrigger(KeyInput.KEY_PGDN));
inputManager.addMapping(TOGGLE_ORTHO, new KeyTrigger(KeyInput.KEY_O));
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name == SPEED_UP)
setCameraSpeed(+1);
else
setCameraSpeed(-1);
}
}, SPEED_UP, SPEED_DOWN);
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (!isPressed)
return;
if (name == AMBIENT_UP)
setAmbient(+1);
else
setAmbient(-1);
}
}, AMBIENT_UP, AMBIENT_DOWN);
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (!isPressed)
return;
if (name == FOV_UP)
setFov(+1);
else
setFov(-1);
}
}, FOV_UP, FOV_DOWN);
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (isPressed) {
TweedSettings.settings.ortho = !TweedSettings.settings.ortho;
setCameraPerspective();
}
}
}, TOGGLE_ORTHO);
}
Aggregations