Lighting is a complex effect dedicated to giving an object pseudo-3D depth by imitating a light source. An algorithm finds node boundaries and graphically elevates them by shading those further from the imaginary light and lighting the closer ones:
To achieve this effect, you'll have to set the location and type of an imaginary light, which shines on the scene and is implemented as shown in the following code snippet:
// chapter8/light/LightingDemo.javapublic void start(Stage primaryStage) { Light.Distant light = new Light.Distant(); light.setAzimuth(-135); Lighting lighting = new Lighting(); lighting.setLight(light); ...