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:
Make sure you have the
Models/HoverTank/tank_glow_map.jpg
texture inModels/HoverTank/
in yourassets
directory.Import the
com.jme3.post
package and add the following code snippet to yoursimpleInitApp()
method:FilterPostProcessor fpp = new FilterPostProcessor(assetManager); viewPort.addProcessor(fpp); BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.SceneAndObjects); fpp.addFilter(bloom);
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", false); mat.setTexture("GlowMap", assetManager.loadTexture(tankGlow)); mat.setColor("GlowColor", ColorRGBA.White);
Run the sample.
You are now a proud owner of the ultimate textured, shiny, bumpy, glowing hover tank. What else could...