---
title: SCNLight
framework: scenekit
role: symbol
role_heading: Class
path: scenekit/scnlight
---

# SCNLight

A light source that can be attached to a node to illuminate the scene.

## Declaration

```swift
class SCNLight
```

## Overview

Overview You illuminate your scene by attaching lights to SCNNode objects using their light property. You set a light’s type using its type property. Depending on a light’s type, its position and direction may affect its behavior—you control the light’s position and direction through the node that the light is attached to. The direction of a light, if applicable to its type, is along the negative z-axis of its node’s local coordinate system. A light’s other properties affect how it illuminates a scene. All lights have a color property, which interacts with SCNMaterial objects to produce the pixel colors in a rendered scene. Other properties, such as attenuation, shadowing, and spot angle, can affect the behavior of certain types of lights. The number and type of lights in a scene is a key factor in SceneKit’s rendering performance. For efficient rendering, follow these tips: Use SceneKit lights only for dynamic light sources or lights that affect moving objects. For statically lit portions of your scene, create a light map texture in an external 3D authoring tool (also known as baked lighting) and apply it to objects in the scene using the multiply material property. Minimize the number of lights on each element of the scene. You can achieve most common lighting effects using no more than three lights, and you only need a single ambient light source. SceneKit only uses up to eight light sources per node when rendering, ignoring any additional lights. If you set the attenuationEndDistance property on a spotlight or omnidirectional light to limit its area of effect, SceneKit ignores the light (and its performance cost) when rendering objects outside that area. You can also use the categoryBitMask property to choose which nodes are illuminated by a light.

## Topics

### Modifying a Light’s Appearance

- [type](scenekit/scnlight/type.md)
- [SCNLight.LightType](scenekit/scnlight/lighttype.md)
- [color](scenekit/scnlight/color.md)
- [temperature](scenekit/scnlight/temperature.md)
- [intensity](scenekit/scnlight/intensity.md)
- [sphericalHarmonicsCoefficients](scenekit/scnlight/sphericalharmonicscoefficients.md)

### Managing Light Attributes

- [name](scenekit/scnlight/name.md)
- [attribute(forKey:)](scenekit/scnlight/attribute(forkey:).md)
- [setAttribute(_:forKey:)](scenekit/scnlight/setattribute(_:forkey:).md)
- [Lighting Attribute Keys](scenekit/lighting-attribute-keys.md)

### Managing Light Attenuation

- [attenuationStartDistance](scenekit/scnlight/attenuationstartdistance.md)
- [attenuationEndDistance](scenekit/scnlight/attenuationenddistance.md)
- [attenuationFalloffExponent](scenekit/scnlight/attenuationfalloffexponent.md)

### Managing Spotlight Extent

- [spotInnerAngle](scenekit/scnlight/spotinnerangle.md)
- [spotOuterAngle](scenekit/scnlight/spotouterangle.md)
- [gobo](scenekit/scnlight/gobo.md)

### Managing Shadows Cast by the Light

- [castsShadow](scenekit/scnlight/castsshadow.md)
- [shadowRadius](scenekit/scnlight/shadowradius.md)
- [shadowColor](scenekit/scnlight/shadowcolor.md)
- [shadowMapSize](scenekit/scnlight/shadowmapsize.md)
- [shadowSampleCount](scenekit/scnlight/shadowsamplecount.md)
- [shadowMode](scenekit/scnlight/shadowmode.md)
- [SCNShadowMode](scenekit/scnshadowmode.md)
- [shadowBias](scenekit/scnlight/shadowbias.md)
- [orthographicScale](scenekit/scnlight/orthographicscale.md)
- [zFar](scenekit/scnlight/zfar.md)
- [zNear](scenekit/scnlight/znear.md)

### Choosing Nodes to be Illuminated by the Light

- [categoryBitMask](scenekit/scnlight/categorybitmask.md)

### Managing Photometric Lights

- [iesProfileURL](scenekit/scnlight/iesprofileurl.md)

### Initializers

- [init(coder:)](scenekit/scnlight/init(coder:).md)

### Instance Properties

- [areaExtents](scenekit/scnlight/areaextents.md)
- [areaPolygonVertices](scenekit/scnlight/areapolygonvertices.md)
- [areaType](scenekit/scnlight/areatype.md)
- [automaticallyAdjustsShadowProjection](scenekit/scnlight/automaticallyadjustsshadowprojection.md)
- [doubleSided](scenekit/scnlight/doublesided.md)
- [drawsArea](scenekit/scnlight/drawsarea.md)
- [forcesBackFaceCasters](scenekit/scnlight/forcesbackfacecasters.md)
- [maximumShadowDistance](scenekit/scnlight/maximumshadowdistance.md)
- [parallaxCenterOffset](scenekit/scnlight/parallaxcenteroffset.md)
- [parallaxCorrectionEnabled](scenekit/scnlight/parallaxcorrectionenabled.md)
- [parallaxExtentsFactor](scenekit/scnlight/parallaxextentsfactor.md)
- [probeEnvironment](scenekit/scnlight/probeenvironment.md)
- [probeExtents](scenekit/scnlight/probeextents.md)
- [probeOffset](scenekit/scnlight/probeoffset.md)
- [probeType](scenekit/scnlight/probetype.md)
- [probeUpdateType](scenekit/scnlight/probeupdatetype.md)
- [sampleDistributedShadowMaps](scenekit/scnlight/sampledistributedshadowmaps.md)
- [shadowCascadeCount](scenekit/scnlight/shadowcascadecount.md)
- [shadowCascadeSplittingFactor](scenekit/scnlight/shadowcascadesplittingfactor.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [SCNAnimatable](scenekit/scnanimatable.md)
- [SCNTechniqueSupport](scenekit/scntechniquesupport.md)

## See Also

### Lighting, Cameras, and Shading

- [SCNCamera](scenekit/scncamera.md)
- [SCNMaterial](scenekit/scnmaterial.md)
- [SCNMaterialProperty](scenekit/scnmaterialproperty.md)
