Time for action – make your hover tank glow

Let's add one last cool effect. We want the jet engines and the energy grid on the bottom of the tank to shine with an electric glow:

  1. Make sure you have the Models/HoverTank/tank_glow_map.jpg texture in Models/HoverTank/ in your assets directory.
  2. Import the com.jme3.post package and add the following code snippet to your simpleInitApp() method:
    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    viewPort.addProcessor(fpp);
    BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.SceneAndObjects);
    fpp.addFilter(bloom);
  3. The following lines load the glow map, and specify the glow color for the model. Add them before the setMaterial() line:
    TextureKey tankGlow = new TextureKey("Models/HoverTank/tank_glow_map.jpg", ...

Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.