{"name":"glslify-stream","version":"0.2.1","description":"create a readable stream of glsl ast nodes that produce a module system","main":"index.js","dependencies":{"cssauron":"~0.0.2","cssauron-glsl":"~0.0.0","glsl-parser":"~0.0.6","glsl-tokenizer":"~0.0.8","shortest":"~0.0.0","through":"~1.1.2","commondir":"0.0.1","stream-combiner":"0.0.2","resolve":"~0.5.1","glsl-resolve":"0.0.1","wrap-stream":"0.0.0"},"devDependencies":{"glsl-deparser":"0.0.2"},"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/glslify-stream.git"},"keywords":["glslify","glsl","module","system","stream"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","bugs":{"url":"https://github.com/chrisdickinson/glslify-stream/issues"},"homepage":"https://github.com/chrisdickinson/glslify-stream","_id":"glslify-stream@0.2.1","dist":{"shasum":"248b3cc21ff0986142c394751e3f7ad787553d9c","tarball":"http://registry-npm.ywwl.com/glslify-stream/download/glslify-stream-0.2.1.tgz","integrity":"sha512-OoB3YKEA06Vc1El+c/zJTsRBPy1yB6V5GU1ZqqP0mrprl8WMQrDIAt7H61YIzEPJgRIw+wzRZ5aoNc4ZIEi0WQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1vwzQi8KG8zpmQnDHB5zR1OfNB2/2ZyOukeCLULHhkAiBR+uFT0QRBRgEi9vTXukxd0UZ/kBwL3co4ZECBPtYZAw=="}],"size":3645,"noattachment":false,"key":"/glslify-stream/-/glslify-stream-0.2.1.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"},{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"readme":"# glslify-stream\n\ngiven a file path, create a readable stream of [glsl-parser](https://github.com/chrisdickinson/glsl-parser) AST nodes that represent the complete dependency tree of a glsl program.\n\n```javascript\n// usage: node test.js main.glsl > output.glsl\nvar glslify = require('./index')\n  , deparser = require('glsl-deparser')\n\nvar file = require('path').resolve(process.argv[process.argv.length - 1])\n\nglslify(file)\n  .pipe(deparser())\n  .pipe(process.stdout)\n```\n\n```c\n// main.glsl\nprecision highp float;\nuniform float time;\nuniform vec2 mouse;\nuniform vec2 resolution;\n\n#pragma glslify: program_one = require(./file1, time=time, mouse=mouse, resolution=resolution)\n#pragma glslify: program_two = require(./file2, time=time, mouse=mouse, resolution=resolution)\n\nint modulo(float x, float y) {\n  return int(x - y * floor(x / y));\n}\n\nvoid main(void) {\n  ivec2 m = ivec2(modulo(gl_FragCoord.x, 2.), modulo(gl_FragCoord.y, 2.));\n\n  if(m.x == 0 || m.y == 0) {\n    program_one();\n  } else { \n    program_two();\n  }\n}\n```\n\n```c\n// file1.glsl\nvoid main(void) {\n  gl_FragColor = vec4(1., 0., 0., 1.);\n}\n\n#pragma glslify: export(main)\n```\n\n```c\n// file2.glsl\nvoid main(void) {\n  gl_FragColor = vec4(0., 0., 1., 1.);\n}\n\n#pragma glslify: export(main)\n```\n\n# GLSL API\n\nGLSLify works by mangling top-level identities in non-root modules.\n\nExported variables will be aliased on requirement.\n\n### \\#pragma glslify: VARIABLE = require(MODULE[, NAME=EXPR])\n\nImport a module and assign it the name `VARIABLE` in the local program.\n\n`MODULE` may be located within `node_modules/` or relative to the current file.\n\n**Quotes are not allowed.**\n\nIf the target module defines `attribute`, `varying`, or `uniform` global variables,\nyou may map those to a local definition or expression:\n\n```c\n\nattribute vec4 position;\n#pragma glslify: x = require(./takes_vec2, module_variable=position.xy)\n\n```\n\nIf a mapping is not defined, those requirements are forwarded on to the module requiring\nthe current module -- if no mappings are found for a definition, an error is raised.\n\n### \\#pragma glslify: export(NAME)\n\nExports a local name from the current module. If the current module is the root, this is\na no-op. There may be only one exported `NAME` per module. The `NAME` may represent a\ntype, function, or variable.\n\n# JS API\n\n### glslify(path_to_file) -> readable stream\n\nReturn a readable stream of AST nodes representing the complete program.\n\n# License\n\nMIT\n","publish_time":1396700886506,"_cnpm_publish_time":1396700886506,"dist-tags":{"latest":"1.1.1"}}