JSPM

gl-checker-texture

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q34362F
  • License MIT

generates a checkered texture

Package Exports

  • gl-checker-texture

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gl-checker-texture) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gl-checker-texture

experimental

Creates a 2x2 checkered repeating WebGL texture. Useful for checkered backgrounds, dotted lines, etc.

var Checker = require('gl-checker-texture')

var tex = Checker(gl)
tex.bind()

Usage

NPM

createTexture(gl[, opt])

Creates a new 2x2 texture with the given options:

  • colors an array of two RGBA colors in bytes. Defaults to #ffffff and #cccccc.

Example:

var tex = createTexture(gl, { colors: [
    [0x50,0x50,0x50,0xff],
    [0x46,0x46,0x46,0xff]
]})

The new texture is set to gl.REPEAT wrap and gl.NEAREST filtering.

License

MIT, see LICENSE.md for details.