WOLFRAM

is an option for Graphics3D and related functions that specifies what simulated lighting to use in coloring 3D surfaces.

Details

  • The following settings can be given:
  • Automaticdefault lighting schemes
    Noneno lighting
    "light"named lighting
    {s1,s2,}light sources s1, s2,
  • Possible named lighting settings "light" include:
  • "Standard"colored light sources in default positions
    "Neutral"white light sources in default positions
    "Accent"a directional white light source in default direction
    "ThreePoint"three directional white light sources in default directions
  • Each light source si can be of the following forms:
  • AmbientLightuniform ambient light
    DirectionalLightdirectional light
    PointLightspherical point light
    SpotLightspotlight
  • Lighting{s1,} combines the light sources si with any inherited light sources. To prevent combining with inherited light sources, use Lighting{None, s1,}.
  • Lighting->Automatic uses ambient light together with four light sources fixed relative to the final displayed image.
  • Lighting can be specified separately for particular objects in Graphics3D by giving a style option Style[obj,Lighting->spec].

Examples

open allclose all

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

Default lighting on gray specular sphere:

Out[1]=1

Neutral lighting on gray specular sphere:

Out[1]=1

Directional light from the top of the specular surface:

Out[1]=1

Specify lighting for each object:

Out[1]=1

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

Lighting Specification  (18)

Default lighting on a white surface:

Out[1]=1

Default lighting when ColorFunction is specified:

Out[1]=1

No lighting means diffuse or specular colors will not be visible:

Out[1]=1

Using Glow specifies pure color without interaction with lights:

Out[2]=2

Ambient light is uniformly applied to all the surfaces in the scene:

Out[1]=1

Ambient light gives overall lighting on the scene:

Out[2]=2

Directional light is specified by a color and a vector defined by two points:

Out[1]=1

Directional lights with different colors:

Out[1]=1

Directional lights with different directions:

Out[1]=1

Directional lights on a specular surface:

Out[1]=1

Specify a spherical point light source by a color and a position:

Out[1]=1

Point lights with different colors:

Out[1]=1

Point lights at various positions:

Out[1]=1

Point lights on specular surfaces:

Out[1]=1

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

Out[1]=1

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 Positions  (3)

Specify the light source position in the graphics coordinate system by default:

Out[2]=2

The light source moves with the graphic when the view point changes:

Out[3]=3

Specify the light position by a fraction of the graphics coordinates using Scaled:

Out[2]=2

The light source moves with the graphic when the view point changes:

Out[3]=3

Specify the light position in the view coordinate system using ImageScaled:

Out[2]=2

The light source position is always fixed relative to the view point:

Out[3]=3

Lighting Attenuation  (3)

By default, point lights are not affected by the distance from an object:

Out[2]=2

Specify a point light that attenuates with respect to the distance:

Out[3]=3

Specify a point light that attenuates by the square of the distance:

Out[4]=4

By default, spotlights fall off sharply outside the cone:

Out[2]=2

Spotlights 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  (8)Generalized and extended use cases

Predefined colored lighting:

Out[1]=1

The colored lighting is equivalent to the following explicit setting:

Out[2]=2

Predefined accent lighting:

Out[1]=1

The accent lighting is equivalent to the following explicit setting:

Out[2]=2

Predefined neutral lighting:

Out[1]=1

The neutral lighting is equivalent to the following explicit setting:

Out[2]=2

Predefined three-point lighting:

Out[1]=1

The three-point lighting is equivalent to the following explicit setting:

Out[2]=2

Specify lighting for each object:

Out[2]=2

Specify lighting within the graphics:

Out[1]=1

If not specified, the target direction is given toward the center of the objects:

Out[1]=1

Specify diffuse and specular colors separately for both objects and lights:

Out[1]=1

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

Set up four white spheres on a plane:

Directional light:

Out[4]=4

Point light:

Out[6]=6

Spotlight:

Out[9]=9

Different light instruments at the corner points:

Out[2]=2
Out[3]=3
Out[4]=4

Build a scene with multiple objects and light sources:

Animate the spotlights:

Out[2]=2

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

Surface color and lighting interact with each other:

Out[1]=1

Diffuse object and lighting colors can be exchanged and produce the same effect:

Out[1]=1

Specular object and lighting colors can be exchanged and produce the same effect:

Out[1]=1

Specularity gives mirror-like reflection:

Out[1]=1

The final color is a linear combination of all the surface colors as well as lighting:

Out[1]=1

Directional light yields rays parallel to the specified direction:

Out[1]=1

Point light yields rays toward all the directions from the position:

Out[1]=1

A spotlight emits conic rays toward the specified direction:

Out[1]=1

Possible Issues  (5)Common pitfalls and unexpected behavior

The default lighting may not be suitable for light surface colors:

Out[1]=1

Neutral lighting can be used to reflect surface colors more naturally:

Out[2]=2

If a color function is given to a plot, then neutral lighting is used automatically:

Out[1]=1

Restore the default colored lighting:

Out[2]=2

Flat surfaces may show little or no reflection:

Out[1]=1

A spotlight on a sphere may display a jagged boundary:

Out[1]=1

Increasing the spot exponent may reduce the effect:

Out[2]=2

Inline Lighting directives specifying light sources add those sources to any inherited specification:

Out[1]=1

Set LightingNone on the graphic to override the default LightingAutomatic setting:

Out[2]=2

Similarly, a sequence of Lighting{s1,} specifications cumulatively adds the lights together:

Out[3]=3

Use list braces to ensure the lighting specification does not leak into subsequent specifications:

Out[4]=4

Neat Examples  (2)Surprising or curious use cases

Random light setups for ring models:

Out[2]=2

A simple light show:

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

Text

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

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

CMS

Wolfram Language. 1988. "Lighting." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Lighting.html.

Wolfram Language. 1988. "Lighting." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Lighting.html.

APA

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

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

BibTeX

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

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

BibLaTeX

@online{reference.wolfram_2025_lighting, organization={Wolfram Research}, title={Lighting}, year={2021}, url={https://reference.wolfram.com/language/ref/Lighting.html}, note=[Accessed: 16-April-2025 ]}

@online{reference.wolfram_2025_lighting, organization={Wolfram Research}, title={Lighting}, year={2021}, url={https://reference.wolfram.com/language/ref/Lighting.html}, note=[Accessed: 16-April-2025 ]}