https://github.com/aras-p/glsl-optimizer

This library is able to optimise GLSL code on the CPU, into better GLSL or even Metal Shaders. Could be very useful to get the most power out of Vuo & possibly in any new dedicated Shader Node.

Component: 

Notes from Team Vuo

Vuo Pro: 

No — available with both Vuo and Vuo Pro licenses

Complexity: 

●●○○ — A few weeks of work

Potential: 

●○○ — Appeals to current community

Comments

I've opened this feature

smokris's picture
Submitted by
Feature status:
Waiting for review by Team Vuo
»
Open for community voting

I've opened this feature request for community voting.

I tested GLSL Optimizer several months ago on one of Vuo's toughest shaders (Shade with Frosted Glass / Frost Image) — it didn't make a measurable performance improvement on that shader on the GPUs I tried. But maybe it could help with other shaders and other GPUs.

@George_Toledo

alexmitchellmus's picture
Submitted by

GeorgeToledo

Great find with minifier! I should run a few of mine through it and see what happens!

There is a library that does validation and syntax highlighting in github- last time I saw it it was MIT and in c++. May help... I'll see if I can find it again.

Thanks for the suggestions on

jstrecker's picture
Submitted by
Feature status:
Open for community voting
»
Tabled by Team Vuo

Thanks for the suggestions on tools to optimize GLSL code. I want to let you know that we looked into each of them, but none panned out.

We tested Aras P's GLSL Optimizer on more of Vuo's GLSL code to see if it would do any better than it did for the frosted glass shader (no improvement). For the noise image shader, the optimizer ended up doing the opposite of what it was intended to. The code ended up 2.5x larger and ran a bit slower. On one GPU it caused the whole system to hang. Looking into the status of GLSL Optimizer, we found that it only supports GLSL 1.20 (OpenGL 2.1), which will be a problem when Vuo moves to GLSL 1.50 (OpenGL 3.2), and Aras P has recently abandoned the project.

We checked out ctrl-alt-test Shader Minifier. Our understanding is that the main thing it does is to rename all variables and functions to a single character. This would obviously be useful for reducing the size of the GLSL source code, but (as noted in the suggestion) that doesn't necessarily have any effect on performance. It requires .NET or Mono.

GLSLChecker is an app that compiles your GLSL vertex and fragment shaders and shows you the errors generated by the OpenGL driver. It's not something we could use for optimizing GLSL, but some of its code could be useful for Ability to edit GLSL shader code in Vuo Editor, so thanks for the tip.

@Jaymie, very disappointing

alexmitchellmus's picture
Submitted by

@Jaymie, very disappointing that GLSL Optimizer didn't work out, but GLSLChecker looks like it could be fantastic in the new GLSL shader editor within Vuo. Code is so much easier to write with a checker! :-) In fact for me its much more necessary than an optimiser, (one could hand optimise by in-lining or run one of the many online optimiser if needed).

Super excited if GLSLChecker makes it way into Vuo 1.3!

Feature status

When we (Team Vuo) plan each release, we try to implement as many of the community's top-voted feature requests as we have time for. Vote your favorite features to the top! (How do Vuo feature requests work?)

  • Submitted to vuo.org
  • Tabled by Team Vuo