-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
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... |
Something like this, I guess: https://github.com/aras-p/glsl-optimizer |
Yeah, that looks very interesting, thanks. |
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. |
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/ |
Cool, thanks for sharing @zz85! |
Moving to gltf-pipeline so it is useful to all exporters/converters, see CesiumGS/gltf-pipeline#1. |
Use 4 spaces for indentation
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:
The text was updated successfully, but these errors were encountered: