Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify GLSL #36

Closed
pjcozzi opened this issue Mar 22, 2013 · 7 comments
Closed

Minify GLSL #36

pjcozzi opened this issue Mar 22, 2013 · 7 comments
Labels

Comments

@pjcozzi
Copy link
Member

pjcozzi commented Mar 22, 2013

To reduce asset size, the converter should have an option (off by default) to minify the generated GLSL.

Removing whitespace and comments is obvious (that is actually all my WebGL engine does now), but minification can be much more aggressive by renaming functions, variables, and even uniforms (and the glTF JSON) in the extreme case.

We can investigate some tools:

@fabrobinet
Copy link
Contributor

Frankly, when you look at the XHR answer of a glsl file - which is gzip, it is so small that I don't see much value of just of a size reduction, if there are more clever optimization that can benefit runtime speed then it would be good...

@ryu2
Copy link

ryu2 commented Sep 27, 2013

Something like this, I guess: https://github.com/aras-p/glsl-optimizer

@fabrobinet
Copy link
Contributor

Yeah, that looks very interesting, thanks.

@pjcozzi
Copy link
Member Author

pjcozzi commented Sep 30, 2013

We are tracking glsl-optimizer in #34. It has some promise, but did not work in all cases.

I agree that minification is minor. We did see an improvement compared to just removing whitespace (~20% ?), but we didn't test gzip.

I'd leave this open as a low-priority since anything we can do reasonably to get our payload size down is a good thing.

@zz85
Copy link

zz85 commented Sep 20, 2015

I came to this issue by chance, just wanted to add that there's an online/js version of glsl-optimizier if anyone's interested to try it. http://zz85.github.io/glsl-optimizer/

@pjcozzi
Copy link
Member Author

pjcozzi commented Sep 20, 2015

Cool, thanks for sharing @zz85!

@pjcozzi pjcozzi mentioned this issue Nov 15, 2015
61 tasks
@pjcozzi
Copy link
Member Author

pjcozzi commented May 28, 2016

Moving to gltf-pipeline so it is useful to all exporters/converters, see CesiumGS/gltf-pipeline#1.

@pjcozzi pjcozzi closed this as completed May 28, 2016
javagl pushed a commit to javagl/glTF that referenced this issue Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants