---
title: "pointLightFrom"
description: "A point light as seen from a point on the shape: the 3D light vector `L`, the 2D direction `toLight` and the `distance`."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "materials"
categorySlug: "materials"
categoryTitle: "Materials & surfaces"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/materials.ts#L1323"
---

# pointLightFrom

A point light as seen from a point on the shape: the 3D light vector `L`, the 2D direction `toLight` and the `distance`.

```ts
pointLightFrom(
  light: {position: Expr; height: Expr | number},
  at: Expr,
  hint: string = 'pl',
): {L: Expr; toLight: Expr; distance: Expr}
```

Import `materials` from `shaders/std` and use `materials.pointLightFrom`.

`position` is in placement coordinates (see `placementPoint`). `height` lifts the light toward the viewer, in the same units. Feed `L` to `lambert` and `distance` to `inverseSquare`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `light` | `{position: Expr; height: Expr \| number}` |  |
| `at` | `Expr` |  |
| `hint` | `string` | Optional. Default `'pl'`. |

## Example

```ts
const onBody = pointLightFrom({position: lightUV, height: u.lightHeight}, frame.sdfUV!)
```

## See also

- [`placementPoint`](/docs/primitives/materials/placementpoint) — A position prop in the shape's own coordinates, so you can compare it with the field.
- [`lambert`](/docs/primitives/materials/lambert) — How much a light falls on a surface: 0 facing away, 1 facing it.
- [`inverseSquare`](/docs/primitives/materials/inversesquare) — How a point light fades with distance: 1 at the source, half at `range`.
- [`keyLightAt`](/docs/primitives/materials/keylightat) — A key light from an angle: the light direction `.L` and the half vector `.H` for highlights.

## Used by

[Irradiance](/docs/components/irradiance)