---
title: "interpolate: attribute in the TypeShade language reference"
description: "interpolate, an attribute in the TypeShade language reference. The decorated form of the interpolate option, location<0, u32, { interpolate: \"flat\" }>…"
url: https://typeshade.dev/reference/attributes/interpolate/
language: en
---

# `@interpolate`

Attribute

The decorated form of the `interpolate` option, `location<0, u32, { interpolate: "flat" }>`, or a type and a sampling as `{ interpolate: ["linear", "centroid"] }`.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
declare function interpolate(type: string, sampling?: string): (target: unknown, context?: unknown) => void
```

## Parameters

- `type` `string`
- `sampling` optional `string`

The declaration also names what the TypeScript decorator runtime hands a decorator, `target` and `context`. A call passes neither.

## Description

An integer varying takes `flat` automatically. `"linear"` and the `"sample"` position are not supported yet by the GLSL backend ([Rule 10.3](https://typeshade.dev/reference/rules/10-3/); GLSL ES 3.00 has `smooth`, `flat` and `centroid` only), so they fail the module closed there.

## See also

- [Attributes](https://typeshade.dev/reference/attributes/)
