Time for action – this city needs more gloom

We use ambient occlusion (SSAO) in scenes with no directional sunlight; for example, to simulate a gloomy indoor scene, a narrow street, or a gray, overcast day.

You activate ambient occlusion as follows:

  1. Make a copy of Main.java and name the class ShadowSSAO.java. Remember to also refactor the first line of the main() method to ShadowSSAO app = new ShadowSSAO().
  2. Add FilterPostProcessor as a class field, and initialize it in the simpleInitApp() method. Add FilterPostProcessor to viewPort of your SimpleApplication:
    private FilterPostProcessor fpp;
    public void simpleInitApp() {
      FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
      viewPort.addProcessor(fpp);
  3. Create an SSAOFilter object (from com.jme3.post.ssao ...

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.