{"name":"glslify-stream","version":"1.0.0","description":"create a readable stream of glsl ast nodes that produce a module system","main":"index.js","dependencies":{"commondir":"0.0.1","cssauron":"~0.0.2","cssauron-glsl":"~0.0.0","emit-function":"0.0.2","glsl-parser":"^1.0.0","glsl-resolve":"0.0.1","glsl-tokenizer":"^1.0.0","resolve":"~0.5.1","shortest":"~0.0.0","stream-combiner":"0.0.2","through":"^2.3.4","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"],"authors":["Hugh Kennedy <hughskennedy@gmail.com> (http://hughsk.io/)","Mikola Lysenko <mikolalysenko@gmail.com> (http://0fps.net)","Chris Dickinson <chris@neversaw.us> (http://neversaw.us)"],"license":"MIT","gitHead":"2bd4b9869eca02f7a23b8a821192d3306ff1582b","bugs":{"url":"https://github.com/chrisdickinson/glslify-stream/issues"},"homepage":"https://github.com/chrisdickinson/glslify-stream","_id":"glslify-stream@1.0.0","_shasum":"58195df8921d38381b42c8c322e6415f3f889b97","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":"chris@neversaw.us"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"58195df8921d38381b42c8c322e6415f3f889b97","tarball":"http://registry-npm.ywwl.com/glslify-stream/download/glslify-stream-1.0.0.tgz","integrity":"sha512-acO4iGi7fIbZdd5oWJzayP+kWZq/PsTGv4aIFOrfPXW2sxkw7ePM2cWualafAxU+i83Fv0tfQtSrlEddvxPsJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPHZg1NDnJb+7veDnCvgH+q1vSYyKEsnGg4DylV0uAaAiEAjKPJiXdqqBXPUlAwUjxDkkkCCTE02WS3c9FdECXKWDQ="}],"size":3822,"noattachment":false,"key":"/glslify-stream/-/glslify-stream-1.0.0.tgz"},"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":1404597079430,"_cnpm_publish_time":1404597079430,"dist-tags":{"latest":"1.1.1"}}