gl-material-demo
v1.0.1
Published
demo your 3d materials!
Downloads
4
Readme
gl-material-demo
Demo your 3d materials!
This module will render an object with a specified material. The material must conform to the format specified in gl-material
, which defines a material as a fragment shader and a list of variable style parameters. The demo will automatically create sliders that let you experiment with changing all the material's parameters.
live demo for gl-lambert-material
install
Add to your project with
npm install gl-material-demo
example
var material = require('gl-normal-material')
var demo = require('gl-material-demo')
demo(material)
usage
demo(material, [opts])
Create a demo by providing a material
that conforms to the gl-material
format.
You can also provide the following optional arguments in opts
opts.complex
simplicial complex to demo material with, ifundefined
will usebunny
opts.flatten
whether to flatten geometry, ifundefined
will usebunny
opts.initial
initial style setting, ifundefined
will be set totrue
opts.lights
array of lights to use in the rendered scene, ifundefined
will use a single point lightopts.canvas
existing canvas element to use, ifundefined
will create oneopts.root
DOM element to append created canvas to, ifundefined
will append todocument.body