---
title: "keyLightXY"
description: "A key light from explicit x and y components, for a second or a crossed light."
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#L800"
---

# keyLightXY

A key light from explicit x and y components, for a second or a crossed light.

```ts
keyLightXY(x: Expr, y: Expr, elevation: number, hint: string = 'kl'): Expr
```

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

Same result as `keyLightAt`: `.L` and `.H`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Expr` |  |
| `y` | `Expr` |  |
| `elevation` | `number` |  |
| `hint` | `string` | Optional. Default `'kl'`. |

## Example

```ts
const fill = keyLightXY(mul(ly, -1), lx, -0.4, 'fill')
```

## See also

- [`keyLightAt`](/docs/primitives/materials/keylightat) — A key light from an angle: the light direction `.L` and the half vector `.H` for highlights.

## Used by

[Crystal](/docs/components/crystal)