# a-big-triangle

> Draws a big triangle

Latest version **1.0.3** (published 2016-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install a-big-triangle
pnpm add a-big-triangle
yarn add a-big-triangle
bun add a-big-triangle
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-12-07 |
| First published | 2013-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/a-big-triangle) |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | triangle, webgl, draw |

## Links

- npm: https://www.npmjs.com/package/a-big-triangle
- Repository: https://github.com/mikolalysenko/a-big-triangle
- Homepage: https://github.com/mikolalysenko/a-big-triangle#readme
- Issues: https://github.com/mikolalysenko/a-big-triangle/issues
- npm.io page: https://npm.io/package/a-big-triangle

## Dependencies (3)

- [gl-vao](https://npm.io/package/gl-vao.md) ^1.2.0
- [weak-map](https://npm.io/package/weak-map.md) ^1.0.5
- [gl-buffer](https://npm.io/package/gl-buffer.md) ^2.1.1

## Recent versions

- 1.0.3 (latest) — 2016-12-07
- 1.0.2 — 2015-06-10
- 1.0.1 — 2015-05-27
- 1.0.0 — 2014-09-15
- 0.0.0 — 2013-08-11

## README

a-big-triangle
==============
Draws a big triangle that covers the entire viewport. Useful for GPGPU or when applying fullscreen postprocessing effects.

If you're wondering *why* a big triangle and not a big square made from two smaller triangles, there are potentially significant [performance advantages](http://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/) in taking the former approach.

## Example

```javascript
var shell = require("gl-now")()
var drawTriangle = require("a-big-triangle")
var createShader = require("gl-shader")

var shader

shell.on("gl-init", function() {
  shader = createShader(shell.gl, 
  "precision mediump float;\
  attribute vec2 position;\
  varying vec2 uv;\
  void main() {\
    uv = position.xy;\
    gl_Position = vec4(position.xy, 0.0, 1.0);\
  }",
  "precision mediump float;\
  varying vec2 uv;\
  void main() {\
    gl_FragColor = vec4(uv, 0, 1);\
  }")
})

shell.on("gl-render", function() {
  shader.bind()
  drawTriangle(shell.gl)
})
```

[Check it out in your browser](http://mikolalysenko.github.io/a-big-triangle/)

## Install

```sh
npm install a-big-triangle
```

## API

### `require("a-big-triangle")(gl)`
Draws a fullscreen triangle.

* `gl` is a WebGL context

## Credits
(c) 2013

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