How to | Change the Lighting of Plots

You can enhance the appearance of 3D graphics in Mathematica by changing the direction and color of plot lighting. Lighting, an option for Graphics3D and related functions, can be combined with other functions and options to yield customized high-quality graphics.

First, create a sphere with no options set:

In[1]:=
Click for copyable input
Out[1]=

The default setting for Lighting is Automatic:

In[2]:=
Click for copyable input
Out[2]=

Here, the explicit settings for Automatic are shown:

In[3]:=
Click for copyable input
Out[3]=

Use white light sources by setting the Lighting to neutral:

In[3]:=
Click for copyable input
Out[3]=

Here, the explicit settings for are shown:

In[4]:=
Click for copyable input
Out[4]=

Turn the lighting off:

In[4]:=
Click for copyable input
Out[4]=

Send blue light from the point with coordinates :

In[5]:=
Click for copyable input
Out[5]=

Send blue and green lights from two different points:

In[6]:=
Click for copyable input
Out[6]=

Ambient lighting is applied from all directions:

In[7]:=
Click for copyable input
Out[7]=

Add blue light from a point:

In[8]:=
Click for copyable input
Out[8]=

Send green light along a vector specified with two points:

In[9]:=
Click for copyable input
Out[9]=

Specify a blue spotlight by its position of origin, its target position on the object, and its half-angle:

In[2]:=
Click for copyable input
Out[2]=

Use lighting in a 3D plot:

In[3]:=
Click for copyable input
Out[3]=
    

Change the position of the spotlight to obtain different views of an object:

In[12]:=
Click for copyable input
Out[12]=

Manipulate the lighting position on a sphere:

New to Mathematica? Find your learning path »
Have a question? Ask support »