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

Lighting your world and providing it with dynamic lights


This recipe will mostly be theories on different lighting types, but we'll also explore a way to easily control the movement of lights.

The four main types of lights that we can use to light up our world are as follows:

  • Ambient Light: This lights up everything in the scene evenly. It's good for avoiding anything to be in a pitch-black state, but it doesn't create any shadows or nuances. Adding a too bright ambient light will give the world a bland look, while giving it a touch of color can set the mood.

  • Directional Light: This shines from a particular direction with perfectly parallel rays and without any falloff. This is usually used to simulate a sun, a bright source of light located far away.

  • Point Light: This shines equally in every direction but with a falloff, meaning this will eventually stop illuminating the surroundings. Usually, this forms most of the light sources in a game scene.

  • Spot Light: This is exactly as it sounds...