WOLFRAM

SpotLight[col,pt,α]

is a three-dimensional graphics directive to use in coloring 3D surfaces that specifies the spotlight of color col at position pt aimed at the center with half-angle α.

SpotLight[col,{pt1,pt2},α]

uses the spotlight at position pt1 aimed at pt2 with half-angle α.

SpotLight[col,{pt,tar},{α,s},att]

uses the spotlight with spot exponent s and attenuation att.

Details

  • SpotLight is also known as search light.
  • SpotLight is typically used to create intense illumination of objects by casting light rays that spread outward in a cone.
  • SpotLight[col,{pt1,pt2},α] yields a light that emanates from the point pt1 but is restricted to a cone with direction from pt1 to pt2, and with half-angle in radians.
  • Colors of light sources col can be defined by RGBColor, Hue or any other color specification.
  • The setting for SpotLight affects only colors associated with diffuse and specular reflection on a 3D surface.
  • Light sources with color specifications of the form {dcol,Specularity[scol]} are effectively taken to have colors dcol for purposes of diffuse reflection and scol for purposes of specular reflection.
  • Diffuse reflection is taken to follow Lambert's law, with light effectively scattered equally in all directions from a surface.
  • Specular reflection effectively takes light to be scattered only close to the mirrorreflection direction, as specified in the notes for Specularity.
  • Light source positions and aiming points pti can be specified as follows:
  • {x,y,z}explicit coordinates that move with the graphic
    Scaled[{x,y,z}]scaled coordinates that move with the graphic
    ImageScaled[{x,y,z}]coordinates fixed relative to the final displayed image
  • In ImageScaled[{x,y,z}], the and run from 0 to 1 across the width and height of the bounding box of the final displayed image. The coordinate runs orthogonal to the plane of the display, and is 0 at the back of the 3D region and 1 at the front.
  • Coordinates specified in Scaled and ImageScaled will often not be between 0 and 1.
  • SpotLight[col,{pt,tar},{α,s}] gives fall-off away from the center of the cone.
  • SpotLight[col,{pt,tar},{α,s},{a,b,c}}] gives attenuation with distance .

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Spotlight on surfaces:

Out[1]=1

Style a surface in a plot:

Out[1]=1

A spotlight from the top of the specular surface:

Out[1]=1

Scope  (7)Survey of the scope of standard use cases

Lighting Specification  (5)

Specify spotlight by position, target position and half-angle:

Out[2]=2

Spotlights with different colors:

Out[1]=1

Spotlights from different positions:

Out[1]=1

Spotlights with different half-angles:

Out[1]=1

Spotlights on specular surfaces:

Out[1]=1

Lighting Attenuation  (2)

By default, spotlights fall off sharply outside the cone:

Out[2]=2

A spotlight with different spot exponent has intensity :

Out[3]=3

Spotlight without attenuation:

Out[2]=2

Spotlight with linear attenuation:

Out[3]=3

Spotlight with quadratic attenuation:

Out[4]=4

Generalizations & Extensions  (2)Generalized and extended use cases

Specify lighting for each object:

Out[5]=5

Specify lighting within the graphics:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Set up four white spheres on a plane:

Spotlight:

Out[5]=5

Different light instruments at the corner points:

Out[2]=2

Build a scene with multiple objects and light sources:

Animate the spotlights:

Out[2]=2

Properties & Relations  (1)Properties of the function, and connections to other functions

A spotlight emits conic rays toward the specified direction:

Out[1]=1

Possible Issues  (2)Common pitfalls and unexpected behavior

The default light scheme uses several colored light sources:

Out[3]=3

Set Lighting to None to turn off the default lights:

Out[4]=4

A spotlight on a sphere may display a jagged boundary:

Out[1]=1

Increasing the spot exponent may reduce the effect:

Out[2]=2

Neat Examples  (1)Surprising or curious use cases

Random light setups for ring models:

Out[2]=2
Wolfram Research (2021), SpotLight, Wolfram Language function, https://reference.wolfram.com/language/ref/SpotLight.html.
Wolfram Research (2021), SpotLight, Wolfram Language function, https://reference.wolfram.com/language/ref/SpotLight.html.

Text

Wolfram Research (2021), SpotLight, Wolfram Language function, https://reference.wolfram.com/language/ref/SpotLight.html.

Wolfram Research (2021), SpotLight, Wolfram Language function, https://reference.wolfram.com/language/ref/SpotLight.html.

CMS

Wolfram Language. 2021. "SpotLight." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SpotLight.html.

Wolfram Language. 2021. "SpotLight." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SpotLight.html.

APA

Wolfram Language. (2021). SpotLight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SpotLight.html

Wolfram Language. (2021). SpotLight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SpotLight.html

BibTeX

@misc{reference.wolfram_2025_spotlight, author="Wolfram Research", title="{SpotLight}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/SpotLight.html}", note=[Accessed: 27-March-2025 ]}

@misc{reference.wolfram_2025_spotlight, author="Wolfram Research", title="{SpotLight}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/SpotLight.html}", note=[Accessed: 27-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_spotlight, organization={Wolfram Research}, title={SpotLight}, year={2021}, url={https://reference.wolfram.com/language/ref/SpotLight.html}, note=[Accessed: 27-March-2025 ]}

@online{reference.wolfram_2025_spotlight, organization={Wolfram Research}, title={SpotLight}, year={2021}, url={https://reference.wolfram.com/language/ref/SpotLight.html}, note=[Accessed: 27-March-2025 ]}