# glsl-out-of-range

> Functions to test if a point is outside ranges, namely useful for 3D/2D scenes that may have reversed bounds

Latest version **1.0.4** (published 2018-12-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install glsl-out-of-range
pnpm add glsl-out-of-range
yarn add glsl-out-of-range
bun add glsl-out-of-range
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-12-31 |
| First published | 2018-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Plotly, Inc. |
| Maintainers | alexcjohnson, andrefarzat, antrg, archmoj, bpostlethwaite, chriddyp, dmt0, etpinard, jackparmer, jackwluo, jmmease, marivet, matthew_plotly, maxkfranz, nicolaskruchten, rmarren1, shammamah, shannon-lal, t4rk, verazabeida, vnieman, wilzbach, xhlu |
| Keywords | plotly, plotly.js, reversed range, 3D scene, 2D scene, webgl, shader function, glsl, glslify |

## Links

- npm: https://www.npmjs.com/package/glsl-out-of-range
- Repository: https://github.com/plotly/glsl-out-of-range
- Issues: https://github.com/plotly/glsl-out-of-range/issues
- npm.io page: https://npm.io/package/glsl-out-of-range

## Recent versions

- 1.0.4 (latest) — 2018-12-31
- 1.0.3 — 2018-11-08
- 1.0.2 — 2018-10-15
- 1.0.1 — 2018-10-15
- 1.0.0 — 2018-10-15

## README

## glsl-out-of-range
Tests if a point is outside ranges. 
It could be useful in vertex & fragment shaders to support reversed ranges (bounds) in 3D/2D scenes.

Function prototypes:

bool outOfRange(float a, float b, float p);

bool outOfRange(vec2 a, vec2 b, vec2 p);

bool outOfRange(vec3 a, vec3 b, vec3 p);

bool outOfRange(vec4 a, vec4 b, vec4 p);

Please note that in the case of vec4 input arguments, only 3 tests are made i.e. for xyz and not for w.

## Example

```glsl
#pragma glslify: outOfRange = require(glsl-out-of-range)

void main() {
  if (outOfRange(bounds[0], bounds[1], position)) discard;

  gl_FragColor = vec4(1.0, 0.5, 0.25, 1.0);
}
```

## Usage

Install with npm:

```
npm install glsl-out-of-range
```

Then use with [glslify](https://github.com/stackgl/glslify).

## API

```glsl
#pragma glslify: outOfRange = require(glsl-out-of-range)
```

## Creators

|   | Github | Twitter |
|---|--------|---------|
|**Alex C. Johnson**| [@alexcjohnson](https://github.com/alexcjohnson) | |
|**Étienne Tétreault-Pinard**| [@etpinard](https://github.com/etpinard) | [@etpinard](https://twitter.com/etpinard) |
|**Mojtaba Samimi**| [@archmoj](https://github.com/archmoj) | |

## Copyright and license

Code and documentation copyright 2018 Plotly, Inc.

Code released under the [MIT license](https://github.com/plotly/plotly.js/blob/master/LICENSE).

Docs released under the [Creative Commons license](https://github.com/plotly/documentation/blob/source/LICENSE).

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