glsl-shader-basic
v1.0.0
Published
a basic glslify shader, ready to go
Downloads
13
Maintainers
Readme
glsl-shader-basic
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
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.