gl-lambert-material
lambert material for 3d scenes using stack.gl
Last updated 5 years ago by freeman-lab .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gl-lambert-material 
SYNC missed versions from official npm registry.

gl-lambert-material

NPM version experimental js-standard-style material

Lambert material for 3d rendering.

As defined in 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 shader component.

live demo


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

install

npm install gl-lambert-material

usage

Use with gl-material to generate a compiled shader, given a gl context and constants to replace

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

Or just get the fragment shader for use elsewhere

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

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

3 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (5)

Copyright 2014 - 2017 © taobao.org |