# gl-lambert-material

> lambert material for 3d scenes using stack.gl

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

## Install

```sh
npm install gl-lambert-material
pnpm add gl-lambert-material
yarn add gl-lambert-material
bun add gl-lambert-material
```

## 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.3 |
| Published | 2016-03-12 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | freeman-lab |
| Maintainers | freeman-lab |
| Keywords | lambert, 3d, shader, webgl, stackgl |

## Links

- npm: https://www.npmjs.com/package/gl-lambert-material
- Repository: https://github.com/freeman-lab/gl-lambert-material
- Homepage: https://github.com/freeman-lab/gl-lambert-material#readme
- Issues: https://github.com/freeman-lab/gl-lambert-material/issues
- npm.io page: https://npm.io/package/gl-lambert-material

## Dependencies (5)

- [glslify](https://npm.io/package/glslify.md) ^5.0.2
- [glsl-light](https://npm.io/package/glsl-light.md) ^2.0.0
- [glsl-light-direction](https://npm.io/package/glsl-light-direction.md) ^2.0.0
- [glsl-light-attenuation](https://npm.io/package/glsl-light-attenuation.md) ^2.0.0
- [glsl-diffuse-oren-nayar](https://npm.io/package/glsl-diffuse-oren-nayar.md) ^1.0.2

## Recent versions

- 1.0.3 (latest) — 2016-03-12
- 1.0.2 — 2016-03-11
- 1.0.1 — 2016-03-11

## README

# gl-lambert-material

[![NPM version][npm-image]][npm-url]
![experimental][experimental-image]
[![js-standard-style][standard-image]][standard-url]
[![material][material-image]][material-url]

Lambert material for 3d rendering.

As defined in [`gl-material`](https://github.com/freeman-lab/gl-material), a `material` is a fragment shader and a set of styles with defaults. This material reflects lighting to produce a soft, diffuse appearence using the [`glsl-diffuse-oren-nayar`](https://github.com/stackgl/glsl-diffuse-oren-nayar) shader component. 

**[live demo](http://gl-lambert-material.surge.sh/)**

--------------------------------------
> `STYLE PARAMETERS`

> `emissive` : `vec3` emissive color (unaffected by light), default `[0.0, 0.0, 0.0]`

> `ambient` : `vec3` ambient color component, default `[0.2, 0.2, 0.2]`

> `diffuse` : `vec3` diffuse color component, default `[0.8, 0.8, 0.8]`

> `roughness` : `float` surface roughness, 0 for smooth, 1 for matte, default `0.7`

> `albedo` : `float` intensity of light reflection, 0 for dark, 1 for bright, default `0.7`

[![image](image/sample.png)](http://gl-lambert-material.surge.sh/)

## install

```
npm install gl-lambert-material
```

## usage

Use with [`gl-material`](https://github.com/freeman-lab/gl-material) to generate a compiled shader, given a `gl` context and constants to replace

```javascript
var lambert = require('gl-lambert-material')
var material = require('gl-material')(gl, lambert, {LIGHTCOUNT: 1})
```

Or just get the fragment shader for use elsewhere

```javascript
var fragment = require('gl-lambert-material').fragment
```

[npm-image]: https://img.shields.io/badge/npm-v1.0.2-lightgray.svg?style=flat-square
[npm-url]: https://npmjs.org/package/gl-lambert-material
[material-image]: https://img.shields.io/badge/gl--material-lambert-lightgray.svg?style=flat-square
[material-url]: https://github.com/freeman-lab/gl-material
[standard-image]: https://img.shields.io/badge/code%20style-standard-lightgray.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[experimental-image]: https://img.shields.io/badge/stability-experimental-lightgray.svg?style=flat-square

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