<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "macOS: 10.8.0 - 10.14.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/GLKEffectPropertyLight",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GLKEffectPropertyLight"
  },
  "title" : "GLKEffectPropertyLight"
}
-->

# GLKEffectPropertyLight

Lighting information for use in GLKit rendering effects.

```
class GLKEffectPropertyLight
```

## Overview

The lighting model implemented by [`GLKEffectPropertyLight`](/documentation/GLKit/GLKEffectPropertyLight) is identical to the lighting model implemented in OpenGL ES 1.1; each light interacts with any material properties on the effect to determine the intensity and color that particular light contributes to the scene at a fragment.

There are three basic kinds of lights: directional, point and spotlights.

- A directional light is considered to be infinitely far away, and always directs light in the same direction. To create a directional light, set the [`position`](/documentation/GLKit/GLKEffectPropertyLight/position) property to a vector whose `x`, `y`, and `z` components specify the direction to the light (that is, the negation of the direction the light is travelling in), and whose `w` component is set to `0.0`.
- A point light is placed at a position within the scene, and emits light in all directions. To create a directional light, set the [`position`](/documentation/GLKit/GLKEffectPropertyLight/position) property to a vector whose `x`, `y`, `z` and `w` components specify the homogenous coordinates for the position of the light in the scene. The `w` component is typically set to `1.0` and must not be set to `0.0`.

The intensity of a point light is adjusted using an distance attenuation function. This function is controlled by adjusting the [`constantAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/constantAttenuation), [`linearAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/linearAttenuation) or [`quadraticAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/quadraticAttenuation) properties. The default values for these properties create a light whose intensity is constant over distance.

- A spotlight is placed at a position within the scene, and emits light in a specific direction in a cone. To create a spotlight, set the [`position`](/documentation/GLKit/GLKEffectPropertyLight/position) property to a vector whose `x`, `y`, `z` and `w` components specify the homogenous coordinates for the position of the light in the scene. The `w` component must not be set to `0.0`. Then, set the [`spotDirection`](/documentation/GLKit/GLKEffectPropertyLight/spotDirection) property to a vector that specifies the direction of the light and the [`spotCutoff`](/documentation/GLKit/GLKEffectPropertyLight/spotCutoff) to a value less than `180.0`.

Like a point light, a spotlight’s intensity can be adjusted using the distance attenuation properties. A spotlight’s intensity can also be changed as a function of the spotlight angle by setting the [`spotExponent`](/documentation/GLKit/GLKEffectPropertyLight/spotExponent) property. The default value for a spotlight creates a spotlight whose intensity is not affected by the angle. That is, the spotlight radiates the same amount of light at the center and at the edge of the cone.

Lighting calculations are performed in eye-space coordinates.  The eye-space coordinates for the position and the spot direction are calculated at the precise moment that new position values are specified and may be affected by other properties of the effect. For more information, see [`GLKBaseEffect`](/documentation/GLKit/GLKBaseEffect).

## Topics

### Configuring Common Lighting Properties

[`enabled`](/documentation/GLKit/GLKEffectPropertyLight/enabled)

A Boolean value that indicates whether calculations should be performed on this light.

[`position`](/documentation/GLKit/GLKEffectPropertyLight/position)

The position of the light in world coordinates.

[`transform`](/documentation/GLKit/GLKEffectPropertyLight/transform)

A transform applied to the light’s position and direction before calculating the contribution of the light.

### Configuring Light Colors

[`ambientColor`](/documentation/GLKit/GLKEffectPropertyLight/ambientColor)

The ambient portion of the light.

[`diffuseColor`](/documentation/GLKit/GLKEffectPropertyLight/diffuseColor)

The diffuse portion of the light.

[`specularColor`](/documentation/GLKit/GLKEffectPropertyLight/specularColor)

The specular portion of the light.

### Configuring Lighting Attenuation

[`constantAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/constantAttenuation)

A constant factor applied to the attenuation of a point light or spotlight.

[`linearAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/linearAttenuation)

A linear factor applied to the attenuation of a point light or spotlight.

[`quadraticAttenuation`](/documentation/GLKit/GLKEffectPropertyLight/quadraticAttenuation)

A quadratic factor applied to the attenuation of a point light or spotlight.

### Configuring Spotlight Properties

[`spotCutoff`](/documentation/GLKit/GLKEffectPropertyLight/spotCutoff)

The angle in degrees where the spotlight is cut off.

[`spotDirection`](/documentation/GLKit/GLKEffectPropertyLight/spotDirection)

A vector indicating the direction the spotlight is projecting.

[`spotExponent`](/documentation/GLKit/GLKEffectPropertyLight/spotExponent)

A value indicating how focused the spotlight is.

### Constants

[`GLKLightingType`](/documentation/GLKit/GLKLightingType)

A constant that describes how lighting is calculated by an effect.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`GLKEffectProperty`](/documentation/GLKit/GLKEffectProperty)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)