1.0.1 • Published 10 years ago
gl-material-demo v1.0.1
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-demoexample
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.complexsimplicial complex to demo material with, ifundefinedwill usebunnyopts.flattenwhether to flatten geometry, ifundefinedwill usebunnyopts.initialinitial style setting, ifundefinedwill be set totrueopts.lightsarray of lights to use in the rendered scene, ifundefinedwill use a single point lightopts.canvasexisting canvas element to use, ifundefinedwill create oneopts.rootDOM element to append created canvas to, ifundefinedwill append todocument.body