Skip to content

Experience-Monks/gl-blend-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gl-blend-demo

stable

A demo to visualize different blend modes. Takes in a shader and context attributes, and returns a GL context with a test image blended over a background.

Usage

NPM

demo = require('gl-blend-demo')(opt)

Build an example where opt can be:

  • options for webgl-context (width, height, etc)
  • shader which can be a function to create a shader (taking gl as first parameter) or a gl-shader object

The canvas width and height defaults to the test texture size (512x512).

demo.render()

Re-renders the demo with the current shader.

demo.shader

The shader to use while rendering.

demo.canvas

A reference to the canvas, which can be appended to the document body.

Contributing

See stackgl/contributing.

License

MIT, see LICENSE.md for details.

About

an example scene which blends foreground and background images

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published