JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35
  • Score
    100M100P100Q12127F
  • License ISC

a webgl compiler browserify transform

Package Exports

  • glify

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 (glify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

glify

A browserify transform that grabs fragment and vertex shaders, compiles and links them with glsl-unit, optimizes with glsl-optimizer, and dumps JSON for browsers.

install

npm install --save-dev glify

use

browserify -t glify foo.js > bar.js

example

var glify = require('glify');

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

becomes

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;}"};