Wondering what’s next for npm?Check out our public roadmap! »

glsl-shader-basic

1.0.0 • Public • Published

glsl-shader-basic

unstable

This is a bare-bones shader for use with glslify that can help get WebGL apps up and running quickly.

It passes position through to gl_Position and renders black for gl_FragColor. Works well with a-big-triangle for quick demos.

Example

var glslify = require('glslify')
var createShader = require('gl-shader')
var triangle = require('a-big-triangle')
 
var vert = glslify('glsl-shader-basic/vert.glsl')
var frag = glslify('glsl-shader-basic/frag.glsl')
 
var shader = createShader(gl, vert, frag)
 
function render() {
  shader.bind()
  triangle(gl)
}

Install

npm install glsl-shader-basic --save

Usage

NPM

glsl-shader-basic/vert.glsl

The vertex shader, just passes position through.

glsl-shader-basic/frag.glsl

The fragment shader, returns opaque black pixels.

License

MIT, see LICENSE.md for details.

Install

npm i glsl-shader-basic

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar