glify

a webgl compiler browserify transform

glify is no longer used or maintained.
Last updated 12 years ago by ansis .
ISC · Original npm · Tarball · package.json
$ cnpm install glify 
SYNC missed versions from official npm registry.

Build Status

glify

Compiles and links GLSL shaders with glsl-unit.

It can be used either as a browserify transform or as a regular node module.

Install

npm install --save-dev glify

Example

var glify = require('glify');
var shader = glify('./fill.*.glsl');

In node, shader will be an object with vertex and fragment properties containing optimized GLSL source from fill.vertex.glsl and fill.fragment.glsl files.

With browserify, you can run browserify -t glify foo.js > bar.js and bar.js will contain:

var shader = {"vertex":"precision mediump float;attribute vec2 a_pos;uniform mat4 u_posmatrix;void main(){gl_Position=u_posmatrix*vec4(a_pos,0,1);gl_PointSize=2.;}","fragment":"precision mediump float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"};

Prepend

You can prepend #defines to the source:

var lineShader = glify('./line.*.glsl', '#define FOO bar');

Current Tags

  • 0.5.1                                ...           latest (11 years ago)

9 Versions

  • 0.5.1 [deprecated]           ...           11 years ago
  • 0.5.0 [deprecated]           ...           11 years ago
  • 0.4.2 [deprecated]           ...           12 years ago
  • 0.4.1 [deprecated]           ...           12 years ago
  • 0.4.0 [deprecated]           ...           12 years ago
  • 0.3.0 [deprecated]           ...           12 years ago
  • 0.2.0 [deprecated]           ...           12 years ago
  • 0.1.0 [deprecated]           ...           12 years ago
  • 0.0.0 [deprecated]           ...           12 years ago
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 7
Last Month 1
Dependencies (4)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |