---
title: "unpack4x8snorm / unpackSnorm4x8: shader function guide"
description: "Normalized packing maps a bounded floating-point interval onto integer fields. Use it to reduce storage or bandwidth when the reduced precision is acceptable."
url: https://typeshade.dev/reference/functions/unpack4x8snorm/
language: en
---

# `unpack4x8snorm`

Function

Normalized packing maps a bounded floating-point interval onto integer fields.

**Related names in other languages**

These related operations can differ in arguments, support, and semantics. The foreign names are not accepted TypeShade aliases. Check the target forms and restrictions.

- GLSL: `unpackSnorm4x8`

[Targets](https://typeshade.dev/reference/functions/unpack4x8snorm/#targets)

## Compare examples

Compare the components, hexadecimal word, and recovered values. Notice which component occupies the low field.

**Example 1`unpack4x8snorm(0x7f817f81)`**

`-1` `1` `-1` `1`

Components in this example

**Result**

`[-1, 1, -1, 1]`

Word in binary: `2139193217`

**Example 2`unpack4x8snorm(0x00000000)`**

`0` `0` `0` `0`

Components in this example

**Result**

`[0, 0, 0, 0]`

Word in binary: `0`

**Example 3`unpack4x8snorm(0x20202020)`**

`0.2519685` `0.2519685` `0.2519685` `0.2519685`

Components in this example

**Result**

`[0.2519685, 0.2519685, 0.2519685, 0.2519685]`

Word in binary: `538976288`

The examples are calculation models and do not run GPU work. The reference below gives the complete call signatures. Decimal results are rounded for display. The stated assumptions determine each example; actual shader results follow the target precision and execution rules.

## When to use it

Use it to reduce storage or bandwidth when the reduced precision is acceptable.

## Inputs and limits

Packing clamps to the normalized interval and quantizes values. Unpacking approximates the original value; the low field belongs to the first component.

For shader input rules and precision, consult [WGSL](https://www.w3.org/TR/WGSL/) and [GLSL ES 3.00](https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf).

## Related functions

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

**WGSL**

`unpack4x8snorm(a)`

**GLSL ES 3.00**

`max(vec4(ivec4(uvec4(a, a >> 8, a >> 16, a >> 24) << 24) >> 24) / 127.0, vec4(-1.0))`

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

Unpacks the four bytes of a `u32` into a `vec4` of values in \[-1, 1\], reading each as a signed byte, the low byte into component 0.

## Syntax

```ts
declare function unpack4x8snorm(a0: u32): vec4
declare function unpack4x8snorm(e: u32): vec4
```

## Parameters

- `e` `u32`

## Return value

`vec4`

## Description

The inverse of `pack4x8snorm`.

## Targets

**WGSL**

`unpack4x8snorm(a)`

**GLSL ES 3.00**

`max(vec4(ivec4(uvec4(a, a >> 8, a >> 16, a >> 24) << 24) >> 24) / 127.0, vec4(-1.0))`

## Examples

- [`gallery/packing-bitcast/packing-bitcast.shade.ts`](https://typeshade.dev/guide/examples/packing-bitcast/)

## See also

- [Functions](https://typeshade.dev/reference/functions/)
- [Builtin table](https://typeshade.dev/guide/language/builtins/#packing)
