Game Development Reference
In-Depth Information
How it works...
The FilterPostProcessor acts as a container for the filters and applies them to the
rendered result. Several filters can be added to the same processor and the order matters. If
we add LightScatteringFilter before bloomFilter , we will get bloom applied
to the light scattering and vice versa.
The bloomFilter works by blurring the image slightly and intensifying colors, making
the result appear a bit softer. Bloom filters work best with tweaking and shouldn't just be
slapped on to the scene. It's easy to be impressed by the initial effect and leave it at that but
it should always be adapted to the art style of the game. A fantasy game in an enchanted
forest might get away with more bloom than a hard-boiled cyberpunk shooter.
The LightScatteringFilter instance does two things. Firstly, it creates a halo of
rays emanating from the direction of the light source. Secondly, if the camera is pointing
towards the light source, it will whiteout the image increasingly, simulating glare.
In a normal skybox, the sun would be static but in this example the sun keeps moving. By
supplying the filter to SunControl , we could keep the logic to update the position within
that class. We will also get some weird effects as the glare will still show. The easy way out
is to simply turn off the effect as the sun gets below the horizon.
Search WWH ::




Custom Search