---
title: "location: type in the TypeShade language reference"
description: "location, a type in the TypeShade language reference. A shader IO location of type T, at the number written: uv: location<0, vec2>."
url: https://typeshade.dev/reference/types/location/
language: en
---

# `location`

Type

A shader IO location of type `T`, at the number written: `uv: location<0, vec2>`.

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

## Syntax

```ts
type location<I extends number, T, O extends { readonly interpolate?: 'perspective' | 'linear' | 'flat' | readonly [type: 'perspective' | 'linear' | 'flat', sampling: 'center' | 'centroid' | 'sample' | 'first' | 'either']; readonly blend_src?: 0 | 1 } = {}> = T
```

## Parameters

- `I` `number`
- `T`
- `O` optional `{ readonly interpolate?: 'perspective' | 'linear' | 'flat' | readonly [type: 'perspective' | 'linear' | 'flat', sampling: 'center' | 'centroid' | 'sample' | 'first' | 'either']; readonly blend_src?: 0 | 1 }`

## Description

An input or output that writes none, `uv: vec2`, takes its location from the compiler; write `location<n, T>` to fix the number or to carry an option. Options: `{ interpolate: "flat" }` or `{ interpolate: ["linear", "centroid"] }`, and `{ blend_src: 0 | 1 }` on a field of a dual-source fragment output struct.

## Examples

- [`gallery/id-pick/id-pick.shade.ts`](https://typeshade.dev/guide/examples/id-pick/)
- [`gallery/twin-structs/twin-structs.shade.ts`](https://typeshade.dev/guide/examples/twin-structs/)

## See also

- [Types](https://typeshade.dev/reference/types/)
