hughsk / glslifyify

A browserify transform stream for glslify
Other
4 stars 1 forks source link

GLSL unit usage? #1

Open gre opened 10 years ago

gre commented 10 years ago

Hi @hughsk,

First of all I want to thank you a lot for making this transformer, because I was actually about to make it and your lib saved me about 10 hours ;-) For the little story, I've start working on this and I use your library in the exemple.

I was wondering if it was possible to add the support of glsl-unit to being able to minimize/optimize the GLSL code. I've used it a few years ago, and it work pretty smoothly after a few customisation.

Also I don't know how this can work with browserify, I mean how you can set options to a browserify transformer, but maybe we could enable it by default (with minification but no renaming of uniforms) if not browserify debug mode?

Happy christmas, @gre

hughsk commented 10 years ago

Hey @gre, glad to hear this has helped you! glsl-transition is looking slick so far.

I'm not too familiar with glsl-unit, the unit testing functionality seems pretty awesome - I'm just wondering if the preprocessing (e.g. //! INCLUDE <file> etc.) it's going through might clash/overlap with what glslify is doing?

glslify has simple minification available, though right now it's not exposed in the browserify transform. As far as I know there's no way to detect browserify's debug mode, but it's possible to toggle minification via a package.json param.

That being said: glslify supports transform streams similar to browserify, though I've not documented it yet. So potentially we could write a minification transform stream using either library without it needing to be built in!

I'll spruce up the docs and look into this a little more, as I was just about to start playing around with this stuff again myself - will keep you posted. Happy christmas :)

gre commented 10 years ago

Oh! glslify already provides minification, cool! maybe we can stick with it then ;-)

Also glslify should compile check the GLSL, right?

Regards,

hughsk commented 10 years ago

Yeah - trying to fix a couple issues in glsl-min-stream then it should be a little closer to glsl-unit's too :)

It checks for syntax errors along the way, but no validation beyond that right now!