- All Implemented Interfaces:
- Styleable,- EventTarget
- Direct Known Subclasses:
- SpotLight
Shape3D outside of its scope.
 The light's intensity can be set to decrease over distance by attenuating it. The attenuation formula
 attn = 1 / (ca + la * dist + qa * dist^2)
 
 defines 3 coefficients: ca, la, and qa, which control the constant, linear, and
 quadratic behaviors of intensity falloff over distance, respectively. The effective color of the light
 at a given point in space is color * attn. It is possible, albeit unrealistic, to specify negative
 values to attenuation coefficients. This allows the resulting attenuation factor to be negative, which
 results in the light's color being subtracted from the material instead of added to it, thus creating a
 "shadow caster".
 
 For a realistic effect, maxRange should be set to a distance at which the attenuation is close to 0
 as this will give a soft cutoff.
- Since:
- JavaFX 8.0
- See Also:
- 
Property SummaryPropertiesTypePropertyDescriptionfinal DoublePropertyThe constant attenuation coefficient.final DoublePropertyThe linear attenuation coefficient.final DoublePropertyThe maximum range of thisPointLight.final DoublePropertyThe quadratic attenuation coefficient.Properties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Field SummaryFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new instance ofPointLightclass with a defaultColor.WHITElight source.PointLight(Color color) Creates a new instance ofPointLightclass using the specified color.
- 
Method SummaryModifier and TypeMethodDescriptionfinal DoublePropertyThe constant attenuation coefficient.final doubleGets the value of the property constantAttenuation.final doubleGets the value of the property linearAttenuation.final doubleGets the value of the property maxRange.final doubleGets the value of the property quadraticAttenuation.final DoublePropertyThe linear attenuation coefficient.final DoublePropertyThe maximum range of thisPointLight.final DoublePropertyThe quadratic attenuation coefficient.final voidsetConstantAttenuation(double value) Sets the value of the property constantAttenuation.final voidsetLinearAttenuation(double value) Sets the value of the property linearAttenuation.final voidsetMaxRange(double value) Sets the value of the property maxRange.final voidsetQuadraticAttenuation(double value) Sets the value of the property quadraticAttenuation.Methods declared in class javafx.scene.LightBasecolorProperty, getColor, getExclusionScope, getScope, isLightOn, lightOnProperty, setColor, setLightOnMethods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
maxRangeThe maximum range of thisPointLight. For a pixel to be affected by this light, its distance to the light source must be less than or equal to the light's maximum range. Any negative value will be treated as 0.Lower maxRangevalues can give better performance as pixels outside the range of the light will not require complex calculation. The attenuation formula can be used to calculate a realisticmaxRangevalue by finding the distance where the attenuation is close enough to 0.Nodes that are inside the light's range can still be excluded from the light's effect by removing them from its scope(or including them in itsexclusion scope). If a node is known to always be outside of the light's range, it is more performant to exclude it from its scope.- Default value:
- Double.POSITIVE_INFINITY
- Since:
- 16
- See Also:
 
- 
constantAttenuationThe constant attenuation coefficient. This is the termcain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 1
- Since:
- 16
- See Also:
 
- 
linearAttenuationThe linear attenuation coefficient. This is the termlain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 0
- Since:
- 16
- See Also:
 
- 
quadraticAttenuationThe quadratic attenuation coefficient. This is the termqain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 0
- Since:
- 16
- See Also:
 
 
- 
- 
Constructor Details- 
PointLightpublic PointLight()Creates a new instance ofPointLightclass with a defaultColor.WHITElight source.
- 
PointLightCreates a new instance ofPointLightclass using the specified color.- Parameters:
- color- the color of the light source
 
 
- 
- 
Method Details- 
setMaxRangepublic final void setMaxRange(double value) Sets the value of the property maxRange.- Property description:
- The maximum range of this PointLight. For a pixel to be affected by this light, its distance to the light source must be less than or equal to the light's maximum range. Any negative value will be treated as 0.Lower maxRangevalues can give better performance as pixels outside the range of the light will not require complex calculation. The attenuation formula can be used to calculate a realisticmaxRangevalue by finding the distance where the attenuation is close enough to 0.Nodes that are inside the light's range can still be excluded from the light's effect by removing them from its scope(or including them in itsexclusion scope). If a node is known to always be outside of the light's range, it is more performant to exclude it from its scope.
- Default value:
- Double.POSITIVE_INFINITY
- Since:
- 16
 
- 
getMaxRangepublic final double getMaxRange()Gets the value of the property maxRange.- Property description:
- The maximum range of this PointLight. For a pixel to be affected by this light, its distance to the light source must be less than or equal to the light's maximum range. Any negative value will be treated as 0.Lower maxRangevalues can give better performance as pixels outside the range of the light will not require complex calculation. The attenuation formula can be used to calculate a realisticmaxRangevalue by finding the distance where the attenuation is close enough to 0.Nodes that are inside the light's range can still be excluded from the light's effect by removing them from its scope(or including them in itsexclusion scope). If a node is known to always be outside of the light's range, it is more performant to exclude it from its scope.
- Default value:
- Double.POSITIVE_INFINITY
- Since:
- 16
 
- 
maxRangePropertyThe maximum range of thisPointLight. For a pixel to be affected by this light, its distance to the light source must be less than or equal to the light's maximum range. Any negative value will be treated as 0.Lower maxRangevalues can give better performance as pixels outside the range of the light will not require complex calculation. The attenuation formula can be used to calculate a realisticmaxRangevalue by finding the distance where the attenuation is close enough to 0.Nodes that are inside the light's range can still be excluded from the light's effect by removing them from its scope(or including them in itsexclusion scope). If a node is known to always be outside of the light's range, it is more performant to exclude it from its scope.- Default value:
- Double.POSITIVE_INFINITY
- Since:
- 16
- See Also:
 
- 
setConstantAttenuationpublic final void setConstantAttenuation(double value) Sets the value of the property constantAttenuation.- Property description:
- The constant attenuation coefficient. This is the term cain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 1
- Since:
- 16
 
- 
getConstantAttenuationpublic final double getConstantAttenuation()Gets the value of the property constantAttenuation.- Property description:
- The constant attenuation coefficient. This is the term cain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 1
- Since:
- 16
 
- 
constantAttenuationPropertyThe constant attenuation coefficient. This is the termcain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 1
- Since:
- 16
- See Also:
 
- 
setLinearAttenuationpublic final void setLinearAttenuation(double value) Sets the value of the property linearAttenuation.- Property description:
- The linear attenuation coefficient. This is the term lain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 0
- Since:
- 16
 
- 
getLinearAttenuationpublic final double getLinearAttenuation()Gets the value of the property linearAttenuation.- Property description:
- The linear attenuation coefficient. This is the term lain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 0
- Since:
- 16
 
- 
linearAttenuationPropertyThe linear attenuation coefficient. This is the termlain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 0
- Since:
- 16
- See Also:
 
- 
setQuadraticAttenuationpublic final void setQuadraticAttenuation(double value) Sets the value of the property quadraticAttenuation.- Property description:
- The quadratic attenuation coefficient. This is the term qain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 0
- Since:
- 16
 
- 
getQuadraticAttenuationpublic final double getQuadraticAttenuation()Gets the value of the property quadraticAttenuation.- Property description:
- The quadratic attenuation coefficient. This is the term qain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.
- Default value:
- 0
- Since:
- 16
 
- 
quadraticAttenuationPropertyThe quadratic attenuation coefficient. This is the termqain the attenuation formula:attn = 1 / (ca + la * dist + qa * dist^2)where distis the distance between the light source and the pixel.- Default value:
- 0
- Since:
- 16
- See Also:
 
 
-