JavaFX Lighting Effect

This effect is used to lighten a node from a light source. There are various kinds of light sources i.e. Point, Distant and Spot. The class javafx.scene.effect.Lighting represents the lighting effect. We need to instantiate this class in order to generate an appropriate effect on the node.

Properties

The properties of the class along with the setter methods are described in the following table.

PropertyDescriptionSetter Methods
bumpInputIt is a Effect object type property. It represents the Bump map input for the effect.setBumpInput(Effect value)
contentInputIt is a Effect object type property. It represents the content input for the Effect.setContentInput(Effect value)
diffuseConstantIt is a Double type property. It represents the diffuse constant.setDiffuseConstant(Double value)
lightIt is a Light object type property. It represents the light source for the effect.setLight(Light value)
specularConstantIt is a double type property. It represents specular constant.setSpecularConstant(double value)
specularExponentIt is a double type property. It represents Specular Exponent.setSpecularExponent(double value)
surfaceScaleIt is double type property. It represents Surface scale of the light.setSurfaceScale(double value)

Constructors

The class contains two constructors.

  1. public Lighting() : creates a new instance of Lighting with the default value of light source.
  2. public Lighting(Light light) : creates a new instance of Lighting with the specified value of light source.

Example:


JavaFX Lighting Effect



Latest Courses