# Surface

interface in `@dioramajs/diorama/effects`

```ts
import type { Surface } from '@dioramajs/diorama/effects'
```

The element's single GL copy. Effects add transforms in the order they sit on the element.

```ts
interface Surface
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `material` | `MeshBasicNodeMaterial` | The material currently drawn. Replaced when the set of transforms changes. |
| `mesh` | `Mesh` | A 1x1 plane on the box. Shared: read or tweak it, never dispose or reparent it. |
| `color` | `color(transform: (color: Node<'vec4'>, input: SurfaceInput) => Node): Off` | Changes the colour. `sample(uv)` reads the element's media with crop and masks applied. |
| `position` | `position(transform: (position: Node<'vec3'>, uv: Node<'vec2'>) => Node): Off` | Moves vertices in the plane's local 1x1 space. |
| `segments` | `segments(count: number): void` | Requests plane subdivisions. The largest request wins, default 1. |
| `uv` | `uv(transform: (uv: Node<'vec2'>) => Node): Off` | Bends box UV (0..1, y up) before sampling. |
| `zoom` | `zoom(scale: number, x?: number, y?: number): void` | Frames the media: scales it by `scale` about the box centre, then moves it by `x`, `y` (box units, y up), on top of object-fit. Unlike a `uv` transform this framing is known outside the shader: `copy.cropAt` includes it and a `crop` set by the copy's owner replaces it, so a flight starts and lands in it. Kept until called again; called from update, it shows in that frame. The framings of the element's effects combine in effect order. Default 1, 0, 0. |

Also exported from `@dioramajs/effects`.

Defined in [packages/effects/src/types.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/effects/src/types.ts#L274).
