# glsl-random

> pseudo-random 2D noise for glslify

Latest version **0.0.5** (published 2015-01-26) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install glsl-random
pnpm add glsl-random
yarn add glsl-random
bun add glsl-random
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2015-01-26 |
| First published | 2014-06-07 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | glsl, glslify, random, noise, pseudo-random, rand, hash, webgl |

## Links

- npm: https://www.npmjs.com/package/glsl-random
- Repository: https://github.com/mattdesl/glsl-random
- Issues: git://github.com/mattdesl/glsl-random/issues
- npm.io page: https://npm.io/package/glsl-random

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2015-01-26
- 0.0.4 — 2014-06-08
- 0.0.3 — 2014-06-07
- 0.0.1 — 2014-06-07
- 0.0.0 — 2014-06-07

## README

# glsl-random [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

The classic 'one-liner' for 2D pseudo-random values in GLSL. This uses a highp version for improved randomness and better stability across GPUs, see here:  
http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/

However, the 'classic' lowp version (with no precision specified) is also included here. Some may find it useful for targeted mobile GPUs. 

![Noise](http://i.imgur.com/CSC7rWV.png)

## usage

```glsl
#pragma glslify: random = require(glsl-random)

...
	float rnd = random(myVec.xy);
```

Typically you might use it like so:

```glsl
gl_FragColor = vec4( vec3( random( gl_FragCoord.xy / resolution.xy ) ), 1.0 );
```

### default precision

Requiring the following will give you a function that doesn't specify any precision:  

```#pragma glslify: random = require(glsl-random/lowp)```

## license

BSD-3-Clause

---
_Source: https://npm.io/package/glsl-random · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
