Skip to content

freeman-lab/gl-material-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gl-material-demo

NPM version experimental js-standard-style

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, if undefined will use bunny
  • opts.flatten whether to flatten geometry, if undefined will use bunny
  • opts.initial initial style setting, if undefined will be set to true
  • opts.lights array of lights to use in the rendered scene, if undefined will use a single point light
  • opts.canvas existing canvas element to use, if undefined will create one
  • opts.root DOM element to append created canvas to, if undefined will append to document.body

About

demo your 3d materials!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published