# glsl-blend-overlay

> blend mode 'overlay' for GLSL

Latest version **1.0.5** (published 2015-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install glsl-blend-overlay
pnpm add glsl-blend-overlay
yarn add glsl-blend-overlay
bun add glsl-blend-overlay
```

## 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.5 |
| Published | 2015-01-26 |
| First published | 2015-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | ecosystem:stackgl, blend, blend mode, mode, glsl, glslify, stackgl |

## Links

- npm: https://www.npmjs.com/package/glsl-blend-overlay
- Repository: https://github.com/Jam3/glsl-blend-overlay
- Issues: https://github.com/Jam3/glsl-blend-overlay/issues
- npm.io page: https://npm.io/package/glsl-blend-overlay

## Recent versions

- 1.0.5 (latest) — 2015-01-26
- 1.0.4 — 2015-01-26
- 1.0.3 — 2015-01-26
- 1.0.2 — 2015-01-25
- 1.0.1 — 2015-01-21
- 1.0.0 — 2015-01-20

## README

# glsl-blend-overlay

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

[(click for demo)](http://jam3.github.io/glsl-blend-overlay/)

Photoshop-like "overlay" blend mode for GLSL.

```glsl
#pragma glslify: blend = require(../)

void main() {
  vec4 bgColor = texture2D(bg, vUv);
  vec4 fgColor = texture2D(foreground, vUv);

  vec3 color = blend(bgColor.rgb, fgColor.rgb);
  gl_FragColor = vec4(color, 1.0);
}
```

## Usage

[![NPM](https://nodei.co/npm/glsl-blend-overlay.png)](https://nodei.co/npm/glsl-blend-overlay/)

#### `blend(vec3 background, vec3 foreground)`

Blends background and foreground with an "overlay" blend mode. The algorithm for each channel is as follows:

```
bg < 0.5 ? (2.0 * bg * fg) : (1.0 - 2.0 * (1.0 - bg) * (1.0 - fg))
```

## Contributing

See [stackgl/contributing](https://github.com/stackgl/contributing).

## License

MIT. See [LICENSE.md](http://github.com/Jam3/glsl-blend-overlay/blob/master/LICENSE.md) for details.

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