Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Improving a scene with postprocessing filters


In the Creating dynamic skybox with moving sun recipe, we created a dynamic skybox that has many applications. It's possible to improve the appearance of this (and any other) scene significantly with postprocessing filters. They are called postprocessing filters because they are applied after the scene has already been rendered. This also makes them affect everything in the scene.

We also covered how to create an advanced postfilter in Chapter 1, SDK Game Development Hub.

How to do it...

The sun we have is now moving across the sky. It has very sharp edges and we can use a bloom filter to smooth it out a bit. Perform the following steps to improve a scene with the help of postprocessing filters:

  1. First of all, we need to create a new FilterPostProcessor instance called processor.

  2. Add this to the main view port, by calling viewPort.addProcessor(processor) from within the application.

  3. Then, we create a new bloom filter called bloomFilter. The default...