Search in sources :

Example 1 with BloomUI

use of jme3test.post.BloomUI in project jmonkeyengine by jMonkeyEngine.

the class TestHoverTank method simpleInitApp.

@Override
public void simpleInitApp() {
    Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
    flyCam.setEnabled(false);
    ChaseCamera chaseCam = new ChaseCamera(cam, tank, inputManager);
    chaseCam.setSmoothMotion(true);
    chaseCam.setMaxDistance(100000);
    chaseCam.setMinVerticalRotation(-FastMath.PI / 2);
    viewPort.setBackgroundColor(ColorRGBA.DarkGray);
    Geometry tankGeom = (Geometry) tank.getChild(0);
    LodControl control = new LodControl();
    tankGeom.addControl(control);
    rootNode.attachChild(tank);
    Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
    DirectionalLight dl = new DirectionalLight();
    dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
    dl.setDirection(lightDir);
    Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
    DirectionalLight dl2 = new DirectionalLight();
    dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
    dl2.setDirection(lightDir2);
    rootNode.addLight(dl);
    rootNode.addLight(dl2);
    rootNode.attachChild(tank);
    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
    bf.setBloomIntensity(2.0f);
    bf.setExposurePower(1.3f);
    fpp.addFilter(bf);
    BloomUI bui = new BloomUI(inputManager, bf);
    viewPort.addProcessor(fpp);
}
Also used : Geometry(com.jme3.scene.Geometry) BloomUI(jme3test.post.BloomUI) LodControl(com.jme3.scene.control.LodControl) ColorRGBA(com.jme3.math.ColorRGBA) Node(com.jme3.scene.Node) Vector3f(com.jme3.math.Vector3f) DirectionalLight(com.jme3.light.DirectionalLight) ChaseCamera(com.jme3.input.ChaseCamera) FilterPostProcessor(com.jme3.post.FilterPostProcessor) BloomFilter(com.jme3.post.filters.BloomFilter)

Aggregations

ChaseCamera (com.jme3.input.ChaseCamera)1 DirectionalLight (com.jme3.light.DirectionalLight)1 ColorRGBA (com.jme3.math.ColorRGBA)1 Vector3f (com.jme3.math.Vector3f)1 FilterPostProcessor (com.jme3.post.FilterPostProcessor)1 BloomFilter (com.jme3.post.filters.BloomFilter)1 Geometry (com.jme3.scene.Geometry)1 Node (com.jme3.scene.Node)1 LodControl (com.jme3.scene.control.LodControl)1 BloomUI (jme3test.post.BloomUI)1