glsl-min-stream
Transform glsl-parser AST nodes on-the-fly by renaming variables into shorter forms.
var tokenizer = parser = deparser = minify = processstdin // <-- the minifier // <-- "false" == no unnecessary whitespace, please. processstdin
API
minifier = require('glsl-minifier')([safe_word_list], should_mutate_storages) -> minifier stream
Create a through stream that rewrites incoming declared variables.
safe_word_list
defaults to["main"]
so that the main function is not overridden.should_mutate_storages
, a boolean defaulted tofalse
, determines whether the minifier should attempt to rewrite variables declared asvarying
,attribute
, oruniform
(usually you do not want to do this, as the client program is expecting specific variable names).
License
MIT