瀏覽代碼

jme3-examples: convert tabs to spaces

Stephen Gold 3 年之前
父節點
當前提交
aa9e1214c7

+ 71 - 71
jme3-examples/src/main/java/jme3test/games/CubeField.java

@@ -248,17 +248,17 @@ public class CubeField extends SimpleApplication implements AnalogListener {
      * Core Game Logic
      */
     private void gameLogic(float tpf){
-    	//Subtract difficulty level in accordance to speed every 10 seconds
-    	if(timer.getTimeInSeconds()>=coreTime2){
-			coreTime2=timer.getTimeInSeconds()+10;
-			if(difficulty<=lowCap){
-				difficulty=lowCap;
-			}
-			else if(difficulty>lowCap){
-				difficulty-=5;
-			}
-		}
-    	
+        //Subtract difficulty level in accordance to speed every 10 seconds
+        if(timer.getTimeInSeconds()>=coreTime2){
+            coreTime2=timer.getTimeInSeconds()+10;
+            if(difficulty<=lowCap){
+                difficulty=lowCap;
+            }
+            else if(difficulty>lowCap){
+                difficulty-=5;
+            }
+        }
+        
         if(speed<.1f){
             speed+=.000001f*tpf*fpsRate;
         }
@@ -274,8 +274,8 @@ public class CubeField extends SimpleApplication implements AnalogListener {
             requestClose(false);
         }else{
             for (int i = 0; i < cubeField.size(); i++){
-            	
-            	//better way to check collision
+
+                //better way to check collision
                 Geometry playerModel = (Geometry) player.getChild(0);
                 Geometry cubeModel = cubeField.get(i);
 
@@ -327,73 +327,73 @@ public class CubeField extends SimpleApplication implements AnalogListener {
      * Determines the colors of the player, floor, obstacle and background
      */
     private void colorLogic() {
-    	if (timer.getTimeInSeconds() >= coreTime){
+        if (timer.getTimeInSeconds() >= coreTime){
             
-        	colorInt++;
+            colorInt++;
             coreTime = timer.getTimeInSeconds() + 20;
         
 
-	        switch (colorInt){
-	            case 1:
-	                obstacleColors.clear();
-	                solidBox = false;
-	                obstacleColors.add(ColorRGBA.Green);
-	                renderer.setBackgroundColor(ColorRGBA.Black);
-	                playerMaterial.setColor("Color", ColorRGBA.White);
-			floorMaterial.setColor("Color", ColorRGBA.Black);
-	                break;
-	            case 2:
-	                obstacleColors.set(0, ColorRGBA.Black);
-	                solidBox = true;
-	                renderer.setBackgroundColor(ColorRGBA.White);
-	                playerMaterial.setColor("Color", ColorRGBA.Gray);
+            switch (colorInt){
+                case 1:
+                    obstacleColors.clear();
+                    solidBox = false;
+                    obstacleColors.add(ColorRGBA.Green);
+                    renderer.setBackgroundColor(ColorRGBA.Black);
+                    playerMaterial.setColor("Color", ColorRGBA.White);
+            floorMaterial.setColor("Color", ColorRGBA.Black);
+                    break;
+                case 2:
+                    obstacleColors.set(0, ColorRGBA.Black);
+                    solidBox = true;
+                    renderer.setBackgroundColor(ColorRGBA.White);
+                    playerMaterial.setColor("Color", ColorRGBA.Gray);
                         floorMaterial.setColor("Color", ColorRGBA.LightGray);
-	                break;
-	            case 3:
-	                obstacleColors.set(0, ColorRGBA.Pink);
-	                break;
-	            case 4:
-	                obstacleColors.set(0, ColorRGBA.Cyan);
-	                obstacleColors.add(ColorRGBA.Magenta);
-	                renderer.setBackgroundColor(ColorRGBA.Gray);
+                    break;
+                case 3:
+                    obstacleColors.set(0, ColorRGBA.Pink);
+                    break;
+                case 4:
+                    obstacleColors.set(0, ColorRGBA.Cyan);
+                    obstacleColors.add(ColorRGBA.Magenta);
+                    renderer.setBackgroundColor(ColorRGBA.Gray);
                         floorMaterial.setColor("Color", ColorRGBA.Gray);
-	                playerMaterial.setColor("Color", ColorRGBA.White);
-	                break;
-	            case 5:
-	                obstacleColors.remove(0);
-	                renderer.setBackgroundColor(ColorRGBA.Pink);
-	                solidBox = false;
-	                playerMaterial.setColor("Color", ColorRGBA.White);
-	                break;
-	            case 6:
-	                obstacleColors.set(0, ColorRGBA.White);
-	                solidBox = true;
-	                renderer.setBackgroundColor(ColorRGBA.Black);
-	                playerMaterial.setColor("Color", ColorRGBA.Gray);
+                    playerMaterial.setColor("Color", ColorRGBA.White);
+                    break;
+                case 5:
+                    obstacleColors.remove(0);
+                    renderer.setBackgroundColor(ColorRGBA.Pink);
+                    solidBox = false;
+                    playerMaterial.setColor("Color", ColorRGBA.White);
+                    break;
+                case 6:
+                    obstacleColors.set(0, ColorRGBA.White);
+                    solidBox = true;
+                    renderer.setBackgroundColor(ColorRGBA.Black);
+                    playerMaterial.setColor("Color", ColorRGBA.Gray);
                         floorMaterial.setColor("Color", ColorRGBA.LightGray);
-	                break;
-	            case 7:
-	                obstacleColors.set(0, ColorRGBA.Green);
-	                renderer.setBackgroundColor(ColorRGBA.Gray);
-	                playerMaterial.setColor("Color", ColorRGBA.Black);
+                    break;
+                case 7:
+                    obstacleColors.set(0, ColorRGBA.Green);
+                    renderer.setBackgroundColor(ColorRGBA.Gray);
+                    playerMaterial.setColor("Color", ColorRGBA.Black);
                         floorMaterial.setColor("Color", ColorRGBA.Orange);
-	                break;
-	            case 8:
-	                obstacleColors.set(0, ColorRGBA.Red);
+                    break;
+                case 8:
+                    obstacleColors.set(0, ColorRGBA.Red);
                         floorMaterial.setColor("Color", ColorRGBA.Pink);
-	                break;
-	            case 9:
-	                obstacleColors.set(0, ColorRGBA.Orange);
-	                obstacleColors.add(ColorRGBA.Red);
-	                obstacleColors.add(ColorRGBA.Yellow);
-	                renderer.setBackgroundColor(ColorRGBA.White);
-	                playerMaterial.setColor("Color", ColorRGBA.Red);
-	                floorMaterial.setColor("Color", ColorRGBA.Gray);
-	                colorInt=0;
-	                break;
-	            default:
-	                break;
-	        }
+                    break;
+                case 9:
+                    obstacleColors.set(0, ColorRGBA.Orange);
+                    obstacleColors.add(ColorRGBA.Red);
+                    obstacleColors.add(ColorRGBA.Yellow);
+                    renderer.setBackgroundColor(ColorRGBA.White);
+                    playerMaterial.setColor("Color", ColorRGBA.Red);
+                    floorMaterial.setColor("Color", ColorRGBA.Gray);
+                    colorInt=0;
+                    break;
+                default:
+                    break;
+            }
         }
     }
     /**

+ 94 - 94
jme3-examples/src/main/java/jme3test/model/anim/TestCustomAnim.java

@@ -54,99 +54,99 @@ import com.jme3.scene.shape.Box;
 
 public class TestCustomAnim extends SimpleApplication {
 
-	private Joint bone;
-	private Armature armature;
-	final private Quaternion rotation = new Quaternion();
-
-	public static void main(String[] args) {
-		TestCustomAnim app = new TestCustomAnim();
-		app.start();
-	}
-
-	@Override
-	public void simpleInitApp() {
-
-		AmbientLight al = new AmbientLight();
-		rootNode.addLight(al);
-
-		DirectionalLight dl = new DirectionalLight();
-		dl.setDirection(Vector3f.UNIT_XYZ.negate());
-		rootNode.addLight(dl);
-
-		Box box = new Box(1, 1, 1);
-
-		VertexBuffer weightsHW = new VertexBuffer(Type.HWBoneWeight);
-		VertexBuffer indicesHW = new VertexBuffer(Type.HWBoneIndex);
-		indicesHW.setUsage(Usage.CpuOnly);
-		weightsHW.setUsage(Usage.CpuOnly);
-		box.setBuffer(weightsHW);
-		box.setBuffer(indicesHW);
-
-		// Setup bone weight buffer
-		FloatBuffer weights = FloatBuffer.allocate(box.getVertexCount() * 4);
-		VertexBuffer weightsBuf = new VertexBuffer(Type.BoneWeight);
-		weightsBuf.setupData(Usage.CpuOnly, 4, Format.Float, weights);
-		box.setBuffer(weightsBuf);
-
-		// Setup bone index buffer
-		ByteBuffer indices = ByteBuffer.allocate(box.getVertexCount() * 4);
-		VertexBuffer indicesBuf = new VertexBuffer(Type.BoneIndex);
-		indicesBuf.setupData(Usage.CpuOnly, 4, Format.UnsignedByte, indices);
-		box.setBuffer(indicesBuf);
-
-		// Create bind pose buffers
-		box.generateBindPose();
-
-		// Create skeleton
-		bone = new Joint("root");
-		bone.setLocalTransform(new Transform(Vector3f.ZERO, Quaternion.IDENTITY, Vector3f.UNIT_XYZ));
-		armature = new Armature(new Joint[] { bone });
-
-		// Assign all vertices to bone 0 with weight 1
-		for (int i = 0; i < box.getVertexCount() * 4; i += 4) {
-			// assign vertex to bone index 0
-			indices.array()[i + 0] = 0;
-			indices.array()[i + 1] = 0;
-			indices.array()[i + 2] = 0;
-			indices.array()[i + 3] = 0;
-
-			// set weight to 1 only for first entry
-			weights.array()[i + 0] = 1;
-			weights.array()[i + 1] = 0;
-			weights.array()[i + 2] = 0;
-			weights.array()[i + 3] = 0;
-		}
-
-		// Maximum number of weights per bone is 1
-		box.setMaxNumWeights(1);
-
-		// Create model
-		Geometry geom = new Geometry("box", box);
-		geom.setMaterial(assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m"));
-		Node model = new Node("model");
-		model.attachChild(geom);
-
-		// Create skeleton control
-		SkinningControl skinningControl = new SkinningControl(armature);
-		model.addControl(skinningControl);
-
-		rootNode.attachChild(model);
-	}
-
-	@Override
-	public void simpleUpdate(float tpf) {
-		// Rotate around X axis
-		Quaternion rotate = new Quaternion();
-		rotate.fromAngleAxis(tpf, Vector3f.UNIT_X);
-
-		// Combine rotation with previous
-		rotation.multLocal(rotate);
-
-		// Set new rotation into bone
-		bone.setLocalTransform(new Transform(Vector3f.ZERO, rotation, Vector3f.UNIT_XYZ));
-
-		// After changing skeleton transforms, must update world data
-		armature.update();
-	}
+    private Joint bone;
+    private Armature armature;
+    final private Quaternion rotation = new Quaternion();
+
+    public static void main(String[] args) {
+        TestCustomAnim app = new TestCustomAnim();
+        app.start();
+    }
+
+    @Override
+    public void simpleInitApp() {
+
+        AmbientLight al = new AmbientLight();
+        rootNode.addLight(al);
+
+        DirectionalLight dl = new DirectionalLight();
+        dl.setDirection(Vector3f.UNIT_XYZ.negate());
+        rootNode.addLight(dl);
+
+        Box box = new Box(1, 1, 1);
+
+        VertexBuffer weightsHW = new VertexBuffer(Type.HWBoneWeight);
+        VertexBuffer indicesHW = new VertexBuffer(Type.HWBoneIndex);
+        indicesHW.setUsage(Usage.CpuOnly);
+        weightsHW.setUsage(Usage.CpuOnly);
+        box.setBuffer(weightsHW);
+        box.setBuffer(indicesHW);
+
+        // Setup bone weight buffer
+        FloatBuffer weights = FloatBuffer.allocate(box.getVertexCount() * 4);
+        VertexBuffer weightsBuf = new VertexBuffer(Type.BoneWeight);
+        weightsBuf.setupData(Usage.CpuOnly, 4, Format.Float, weights);
+        box.setBuffer(weightsBuf);
+
+        // Setup bone index buffer
+        ByteBuffer indices = ByteBuffer.allocate(box.getVertexCount() * 4);
+        VertexBuffer indicesBuf = new VertexBuffer(Type.BoneIndex);
+        indicesBuf.setupData(Usage.CpuOnly, 4, Format.UnsignedByte, indices);
+        box.setBuffer(indicesBuf);
+
+        // Create bind pose buffers
+        box.generateBindPose();
+
+        // Create skeleton
+        bone = new Joint("root");
+        bone.setLocalTransform(new Transform(Vector3f.ZERO, Quaternion.IDENTITY, Vector3f.UNIT_XYZ));
+        armature = new Armature(new Joint[] { bone });
+
+        // Assign all vertices to bone 0 with weight 1
+        for (int i = 0; i < box.getVertexCount() * 4; i += 4) {
+            // assign vertex to bone index 0
+            indices.array()[i + 0] = 0;
+            indices.array()[i + 1] = 0;
+            indices.array()[i + 2] = 0;
+            indices.array()[i + 3] = 0;
+
+            // set weight to 1 only for first entry
+            weights.array()[i + 0] = 1;
+            weights.array()[i + 1] = 0;
+            weights.array()[i + 2] = 0;
+            weights.array()[i + 3] = 0;
+        }
+
+        // Maximum number of weights per bone is 1
+        box.setMaxNumWeights(1);
+
+        // Create model
+        Geometry geom = new Geometry("box", box);
+        geom.setMaterial(assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m"));
+        Node model = new Node("model");
+        model.attachChild(geom);
+
+        // Create skeleton control
+        SkinningControl skinningControl = new SkinningControl(armature);
+        model.addControl(skinningControl);
+
+        rootNode.attachChild(model);
+    }
+
+    @Override
+    public void simpleUpdate(float tpf) {
+        // Rotate around X axis
+        Quaternion rotate = new Quaternion();
+        rotate.fromAngleAxis(tpf, Vector3f.UNIT_X);
+
+        // Combine rotation with previous
+        rotation.multLocal(rotate);
+
+        // Set new rotation into bone
+        bone.setLocalTransform(new Transform(Vector3f.ZERO, rotation, Vector3f.UNIT_XYZ));
+
+        // After changing skeleton transforms, must update world data
+        armature.update();
+    }
 
 }

+ 1 - 1
jme3-examples/src/main/java/jme3test/model/anim/TestSkeletonControlRefresh.java

@@ -104,7 +104,7 @@ public class TestSkeletonControlRefresh extends SimpleApplication implements Act
                 for (AnimClip animClip : animComposer.getAnimClips()) {
                     Action action = animComposer.action(animClip.getName());
                     animComposer.addAction(animClip.getName(), new BaseAction(
-                    		Tweens.sequence(action, Tweens.callMethod(animComposer, "removeCurrentAction", AnimComposer.DEFAULT_LAYER))));
+                            Tweens.sequence(action, Tweens.callMethod(animComposer, "removeCurrentAction", AnimComposer.DEFAULT_LAYER))));
                 }
                 animComposer.setCurrentAction(new ArrayList<>(animComposer.getAnimClips()).get((i + j) % 4).getName());
 

+ 121 - 122
jme3-examples/src/main/java/jme3test/post/TestBloomAlphaThreshold.java

@@ -54,130 +54,129 @@ import com.jme3.util.SkyFactory.EnvMapType;
 
 public class TestBloomAlphaThreshold extends SimpleApplication
 {
-	private boolean active = true;
-	private FilterPostProcessor fpp;
-
-	public static void main(String[] args)
-	{
-		TestBloomAlphaThreshold app = new TestBloomAlphaThreshold();
-		app.start();
-	}
-
-	@Override
-	public void simpleInitApp()
-	{
-		// put the camera in a bad position
-		cam.setLocation(new Vector3f(-2.336393f, 11.91392f, -10));
-		cam.setRotation(new Quaternion(0.23602544f, 0.11321983f, -0.027698677f, 0.96473104f));
-		// cam.setFrustumFar(1000);
-
-		Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
-
-		mat.setFloat("Shininess", 15f);
-		mat.setBoolean("UseMaterialColors", true);
-		mat.setColor("Ambient", ColorRGBA.Yellow.mult(0.2f));
-		mat.setColor("Diffuse", ColorRGBA.Yellow.mult(0.2f));
-		mat.setColor("Specular", ColorRGBA.Yellow.mult(0.8f));
-		mat.setColor("GlowColor", ColorRGBA.Green);
-
-		Material matSoil = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
-		matSoil.setFloat("Shininess", 15f);
-		matSoil.setBoolean("UseMaterialColors", true);
-		matSoil.setColor("Ambient", ColorRGBA.Gray);
-		matSoil.setColor("Diffuse", ColorRGBA.Black);
-		matSoil.setColor("Specular", ColorRGBA.Gray);
-
-		Spatial teapot
-                        = assetManager.loadModel("Models/Teapot/Teapot.obj");
-		teapot.setLocalTranslation(0, 0, 10);
-
-		teapot.setMaterial(mat);
-		teapot.setShadowMode(ShadowMode.CastAndReceive);
-		teapot.setLocalScale(10.0f);
-		rootNode.attachChild(teapot);
-
-                Vector3f boxMin1 = new Vector3f(-800f, -23f, -150f);
-                Vector3f boxMax1 = new Vector3f(800f, 3f, 1250f);
-                Box boxMesh1 = new Box(boxMin1, boxMax1);
-		Geometry soil = new Geometry("soil", boxMesh1);
-		soil.setMaterial(matSoil);
-		soil.setShadowMode(ShadowMode.CastAndReceive);
-		rootNode.attachChild(soil);
-
-		Material matBox = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
-		matBox.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
-		matBox.setFloat("AlphaDiscardThreshold", 0.5f);
+    private boolean active = true;
+    private FilterPostProcessor fpp;
+
+    public static void main(String[] args)
+    {
+        TestBloomAlphaThreshold app = new TestBloomAlphaThreshold();
+        app.start();
+    }
+
+    @Override
+    public void simpleInitApp()
+    {
+        // put the camera in a bad position
+        cam.setLocation(new Vector3f(-2.336393f, 11.91392f, -10));
+        cam.setRotation(new Quaternion(0.23602544f, 0.11321983f, -0.027698677f, 0.96473104f));
+        // cam.setFrustumFar(1000);
+
+        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
+
+        mat.setFloat("Shininess", 15f);
+        mat.setBoolean("UseMaterialColors", true);
+        mat.setColor("Ambient", ColorRGBA.Yellow.mult(0.2f));
+        mat.setColor("Diffuse", ColorRGBA.Yellow.mult(0.2f));
+        mat.setColor("Specular", ColorRGBA.Yellow.mult(0.8f));
+        mat.setColor("GlowColor", ColorRGBA.Green);
+
+        Material matSoil = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
+        matSoil.setFloat("Shininess", 15f);
+        matSoil.setBoolean("UseMaterialColors", true);
+        matSoil.setColor("Ambient", ColorRGBA.Gray);
+        matSoil.setColor("Diffuse", ColorRGBA.Black);
+        matSoil.setColor("Specular", ColorRGBA.Gray);
+
+        Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
+        teapot.setLocalTranslation(0, 0, 10);
+
+        teapot.setMaterial(mat);
+        teapot.setShadowMode(ShadowMode.CastAndReceive);
+        teapot.setLocalScale(10.0f);
+        rootNode.attachChild(teapot);
+
+        Vector3f boxMin1 = new Vector3f(-800f, -23f, -150f);
+        Vector3f boxMax1 = new Vector3f(800f, 3f, 1250f);
+        Box boxMesh1 = new Box(boxMin1, boxMax1);
+        Geometry soil = new Geometry("soil", boxMesh1);
+        soil.setMaterial(matSoil);
+        soil.setShadowMode(ShadowMode.CastAndReceive);
+        rootNode.attachChild(soil);
+
+        Material matBox = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
+        matBox.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
+        matBox.setFloat("AlphaDiscardThreshold", 0.5f);
     
-                Vector3f boxMin2 = new Vector3f(-5.5f, 8f, -4f);
-                Vector3f boxMax2 = new Vector3f(-1.5f, 12f, 0f);
-                Box boxMesh2 = new Box(boxMin2, boxMax2);
-		Geometry box = new Geometry("box", boxMesh2);
-		box.setMaterial(matBox);
-                box.setQueueBucket(RenderQueue.Bucket.Translucent);
-		// box.setShadowMode(ShadowMode.CastAndReceive);
-		rootNode.attachChild(box);
-
-		DirectionalLight light = new DirectionalLight();
-		light.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
-		light.setColor(ColorRGBA.White.mult(1.5f));
-		rootNode.addLight(light);
-
-		// load sky
-		Spatial sky = SkyFactory.createSky(assetManager, 
+        Vector3f boxMin2 = new Vector3f(-5.5f, 8f, -4f);
+        Vector3f boxMax2 = new Vector3f(-1.5f, 12f, 0f);
+        Box boxMesh2 = new Box(boxMin2, boxMax2);
+        Geometry box = new Geometry("box", boxMesh2);
+        box.setMaterial(matBox);
+        box.setQueueBucket(RenderQueue.Bucket.Translucent);
+        // box.setShadowMode(ShadowMode.CastAndReceive);
+        rootNode.attachChild(box);
+
+        DirectionalLight light = new DirectionalLight();
+        light.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
+        light.setColor(ColorRGBA.White.mult(1.5f));
+        rootNode.addLight(light);
+
+        // load sky
+        Spatial sky = SkyFactory.createSky(assetManager, 
                         "Textures/Sky/Bright/FullskiesBlueClear03.dds",
                         EnvMapType.CubeMap);
-		sky.setCullHint(Spatial.CullHint.Never);
-		rootNode.attachChild(sky);
-
-		fpp = new FilterPostProcessor(assetManager);
-		int numSamples = getContext().getSettings().getSamples();
-		if (numSamples > 0)
-		{
-			fpp.setNumSamples(numSamples);
-		}
-
-		BloomFilter bloom = new BloomFilter(GlowMode.Objects);
-		bloom.setDownSamplingFactor(2);
-		bloom.setBlurScale(1.37f);
-		bloom.setExposurePower(3.30f);
-		bloom.setExposureCutOff(0.2f);
-		bloom.setBloomIntensity(2.45f);
-		BloomUI ui = new BloomUI(inputManager, bloom);
-
-		viewPort.addProcessor(fpp);
-		fpp.addFilter(bloom);
-		initInputs();
-
-	}
-
-	private void initInputs()
-	{
-		inputManager.addMapping("toggle", new KeyTrigger(KeyInput.KEY_SPACE));
-
-		ActionListener acl = new ActionListener()
-		{
-
-			@Override
-			public void onAction(String name, boolean keyPressed, float tpf)
-			{
-				if (name.equals("toggle") && keyPressed)
-				{
-					if (active)
-					{
-						active = false;
-						viewPort.removeProcessor(fpp);
-					}
-					else
-					{
-						active = true;
-						viewPort.addProcessor(fpp);
-					}
-				}
-			}
-		};
-
-		inputManager.addListener(acl, "toggle");
-
-	}
+        sky.setCullHint(Spatial.CullHint.Never);
+        rootNode.attachChild(sky);
+
+        fpp = new FilterPostProcessor(assetManager);
+        int numSamples = getContext().getSettings().getSamples();
+        if (numSamples > 0)
+        {
+            fpp.setNumSamples(numSamples);
+        }
+
+        BloomFilter bloom = new BloomFilter(GlowMode.Objects);
+        bloom.setDownSamplingFactor(2);
+        bloom.setBlurScale(1.37f);
+        bloom.setExposurePower(3.30f);
+        bloom.setExposureCutOff(0.2f);
+        bloom.setBloomIntensity(2.45f);
+        BloomUI ui = new BloomUI(inputManager, bloom);
+
+        viewPort.addProcessor(fpp);
+        fpp.addFilter(bloom);
+        initInputs();
+
+    }
+
+    private void initInputs()
+    {
+        inputManager.addMapping("toggle", new KeyTrigger(KeyInput.KEY_SPACE));
+
+        ActionListener acl = new ActionListener()
+        {
+
+            @Override
+            public void onAction(String name, boolean keyPressed, float tpf)
+            {
+                if (name.equals("toggle") && keyPressed)
+                {
+                    if (active)
+                    {
+                        active = false;
+                        viewPort.removeProcessor(fpp);
+                    }
+                    else
+                    {
+                        active = true;
+                        viewPort.addProcessor(fpp);
+                    }
+                }
+            }
+        };
+
+        inputManager.addListener(acl, "toggle");
+
+    }
 
 }