---
title: "vec3(): IR builder function in typeshade/core/ir, TypeShade"
description: "vec3, an IR builder function in typeshade/core/ir. A vec3<f32> constructor, WGSL-style: vec3(x, y, z)."
url: https://typeshade.dev/api/vec3/
language: en
---

# `vec3()`

Function in Builtins

A `vec3<f32>` constructor, WGSL-style: `vec3`(x, y, z).

`import { vec3 } from 'typeshade/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`vec3()`](https://typeshade.dev/reference/functions/vec3/)

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

## Syntax

```ts
const vec3: (...a: NodeLike[]) => Node<"vec3<f32>">
```

## Parameters

**`...a` `NodeLike[]`**

## Return value

`Node<'vec3<f32>'>`

## Description

Bare number components lift to `f32`.

## Examples

### Example

```ts
import { vec3 } from 'typeshade/core/ir'

const rgb = vec3(1, 0, 0)  // Node<'vec3<f32>'>
```

## In the guide

- [Language guide](https://typeshade.dev/guide/internals/)
- [Values and mutation](https://typeshade.dev/guide/internals/values-and-mutation/)
- [fp64](https://typeshade.dev/guide/internals/fp64/)

## See also

- [`vec3()`](https://typeshade.dev/reference/functions/vec3/)

## Source

[`src/core/ir/node.ts`, line 2229](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2229), at commit af54ddad5
