---
title: "SamplerOptions: interface in Runtime, TypeShade API"
description: "SamplerOptions, an interface in Runtime. What rt.sampler() makes. The program runtime that runs compiled programs on WebGPU…"
url: https://typeshade.dev/api/sampleroptions/
language: en
---

# `SamplerOptions`

Interface in Runtime

What rt.sampler() makes.

`import type { SamplerOptions } from 'typeshade/runtime'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
interface SamplerOptions {
  readonly filter?: 'nearest' | 'linear';
  readonly address?: 'clamp' | 'repeat' | 'mirror';
  readonly compare?: CompareFunction;
}
```

## Instance properties

**`filter` optional read only `'nearest' | 'linear'`**

How it magnifies, minifies and picks between mip levels: `'linear'` when omitted.

**`address` optional read only `'clamp' | 'repeat' | 'mirror'`**

What it reads past an edge, on every axis: `'clamp'` (clamp to the edge) when omitted.

**`compare` optional read only `CompareFunction`**

A comparison sampler, for a depth texture a shadow pass wrote: the comparison it makes.

## Source

[`src/runtime/resources.ts`, line 75](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/resources.ts#L75), at commit af54ddad5
