AmbientLight[col]
is a three-dimensional graphics directive that specifies the uniform ambient light of color col to use in coloring 3D surfaces.
AmbientLight
AmbientLight[col]
is a three-dimensional graphics directive that specifies the uniform ambient light of color col to use in coloring 3D surfaces.
Details
- AmbientLight is also known as natural light.
- AmbientLight is typically used to fill areas that do not have enough illumination by casting soft light rays in every direction.
- AmbientLight[col] yields a uniform ambient light of color col.
- Colors of light sources col can be defined by RGBColor, Hue or any other color specification.
- The setting for AmbientLight 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 mirror‐reflection direction, as specified in the notes for Specularity.
Examples
open all close allBasic Examples (2)
Graphics3D[{AmbientLight[Orange], Sphere[], Cuboid[{1, 2, -1}, {2, 3, 1}], Cylinder[{{3, -1, 0}, {3, -1, 1}}]}, Lighting -> None]Plot3D[Sin[x + y ^ 2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> AmbientLight[Orange]]Scope (2)
Ambient light is uniformly applied to all the surfaces in the scene:
Graphics3D[{AmbientLight[Orange], Sphere[], Cuboid[{1, 2, -1}, {2, 3, 1}], Cylinder[{{3, -1, 0}, {3, -1, 1}}]}, Lighting -> None]Ambient light gives overall lighting on the scene:
l1 = AmbientLight[GrayLevel[.3]];
l2 = DirectionalLight[Orange, {{1, 1, 1}, {0, 0, 0}}];{Graphics3D[{l2, EdgeForm[], Sphere[], Cuboid[{1, 2, -1}, {2, 3, 1}], Cylinder[{{3, -1, 0}, {3, -1, 1}}]}, Lighting -> None],
Graphics3D[{l1, l2, EdgeForm[], Sphere[], Cuboid[{1, 2, -1}, {2, 3, 1}], Cylinder[{{3, -1, 0}, {3, -1, 1}}]}, Lighting -> None]}Generalizations & Extensions (2)
Graphics3D[Sphere[], Lighting -> Automatic]The colored lighting is equivalent to the following explicit setting:
Graphics3D[{Sphere[], AmbientLight[RGBColor[{0.4, 0.2, 0.2}]], DirectionalLight[RGBColor[{0., 0.18, 0.5}], ImageScaled[{2, 0, 2}]], DirectionalLight[RGBColor[{0.18, 0.5, 0.18}], ImageScaled[{2, 2, 3}]], DirectionalLight[RGBColor[{0.5, 0.18, 0.}], ImageScaled[{0, 2, 2}]], DirectionalLight[RGBColor[{0., 0., 0.18}], ImageScaled[{0, 0, 2}]]}]Graphics3D[{Sphere[]}, Lighting -> "Neutral"]The neutral lighting is equivalent to the following explicit setting:
Graphics3D[{AmbientLight[RGBColor[{.35, .35, .35}]], DirectionalLight[RGBColor[{.37, .37, .37}], ImageScaled[{2, 0, 2}]], DirectionalLight[RGBColor[{.37, .37, .37}], ImageScaled[{2, 2, 2}]], DirectionalLight[RGBColor[{.37, .37, .37}], ImageScaled[{0, 2, 2}]], Sphere[]}, Lighting -> None]Applications (1)
Build a scene with multiple objects and light sources:
col = {Red, Green, Blue};
objs = Graphics3D[{Specularity[White, 2], EdgeForm[], Cylinder[{{2, 2, 0}, {2, 2, 4}}], Cylinder[{{6, 2, 0}, {6, 2, 4}}], Cylinder[{{10, 2, 0}, {10, 2, 4}}]}];
walls = ParametricPlot3D[{{u, v - 2, 0}, {u, 4, 2v}}, {u, -2, 14}, {v, 0, 6}, PlotPoints -> 15, MaxRecursion -> 0, PlotStyle -> Specularity[White, 2], Mesh -> None, Axes -> False];
srcs[pos_] := Graphics3D[MapThread[{DirectionalLight[#1, {{0, -1, 0}, {0, 0, 0}}], Sphere[{#2, 0, 8}, .3]}&, {col, pos}]];
lights[pos_] := Join[{AmbientLight[GrayLevel[.1]]}, Sequence@@MapThread[{SpotLight[#1, {{#2, 0, 8}, {#2, 3, 0}}, {Pi / 2, 20}], {PointLight[#1, {#2, 0, 8}, {0, 8, 0}]}}&, {col, pos}]];Animate[With[{rx = -6Cos[t] + 6, gx = 6Sin[t] + 6, bx = 6Cos[t] + 6}, Show[objs, walls, srcs[{rx, gx, bx}], Lighting -> lights[{rx, gx, bx}], Background -> Black, Boxed -> False, ImageSize -> 300]], {t, 0, 2Pi}, SaveDefinitions -> True, AnimationRunning -> False]Possible Issues (1)
Neat Examples (1)
p1[θ_] := RotationTransform[θ, {0, 0, 1}][{0, 2, 0}];
p2[θ_] := RotationTransform[θ + Pi / 2, {1, 0, 1}][{0, 2, 0}];
p3[θ_] := RotationTransform[θ + Pi, {1, 0, 0}][{0, 2, 0}];
p4[θ_] := RotationTransform[θ + 3Pi / 2, {1, 0, -1}][{0, 2, 0}];Animate[Graphics3D[{AmbientLight[GrayLevel[.1]], PointLight[Red, p1[θ]], PointLight[Green, p2[θ]], PointLight[Blue, p3[θ]], PointLight[Yellow, p4[θ]], Specularity[White, 30], Sphere[], Sphere[p1[θ], .4], Sphere[p2[θ], .4], Sphere[p3[θ], .4], Sphere[p4[θ], .4]}, Lighting -> None, PlotRange -> 2.5, Background -> Black, Boxed -> False, ImageSize -> 300], {θ, 0, 2Pi}, SaveDefinitions -> True, AnimationRunning -> False]Related Guides
History
Text
Wolfram Research (2021), AmbientLight, Wolfram Language function, https://reference.wolfram.com/language/ref/AmbientLight.html.
CMS
Wolfram Language. 2021. "AmbientLight." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AmbientLight.html.
APA
Wolfram Language. (2021). AmbientLight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AmbientLight.html
BibTeX
@misc{reference.wolfram_2026_ambientlight, author="Wolfram Research", title="{AmbientLight}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/AmbientLight.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_ambientlight, organization={Wolfram Research}, title={AmbientLight}, year={2021}, url={https://reference.wolfram.com/language/ref/AmbientLight.html}, note=[Accessed: 12-June-2026]}