Online GLSL Shader optimizer

shaders

#1

Hey all,

Met a guy at the TA Bootcamp over at GDC and he was telling me about his free online shader optimizer / obfuscater. The question he asked me was would you use this in production? The site has just gone up so it’s early days, but I would be interested on what you think about using this service.

http://www.lunarg.com/3d-app-developer/

My main concern would be uploading company shaders to be optimized rather than having a standalone app to do it. Maybe an offline version that you can pay for?

~B)


#2

1- It’d need to be something that can be integrated into a pipeline- a web app is sort of useless.
2- I have a hard time believing this guy’s optimizer does a better job optimizing a shader than the compiler would. Though I guess the type of optimization that can be done in this way (packing registers, etc) is different from what a compiler can do, so I guess its worth it (and they seem to know their stuff, so I would take them at their word).
3- I have no idea what you’d need obfuscation for- wouldn’t you just ship the shaders as assembly code if you were worried about people seeing your shader code?


#3

Yeah, not sure what the obfuscation was for, and definitely have a comandline interface for the standalone app.

They are saying that some of the mobile platform compilers are doing a poor job with optimization.

http://www.lunarg.com/2011/03/the-story-behind-lunargoo/

and what spawned it’s creation

http://aras-p.info/blog/2010/09/29/glsl-optimizer/

.


#4

My guess is he’s just running the code through the GLSL compiler (or even CGC) and then just reverse-assembling it. Which is exactly what all those “temp25” etc variables would look like.

Value of optimizing an already-optimized function: questionable.


#5

Hi Bjorke,

LunarGOO is actually a complete shader compiler based on LunarGLASS, LLVM, and a GLSL backend.

It certainly is right to imply we only bring optimizations where they might be missing from a platform’s native compiler, but we are bringing a large number of optimizations online quickly and welcome any feedback on performance improvements folks are seeing, and which environments they are seeing the improvements on.

Of course we welcome feedback on bugs and feature requests as well. We use all this valuable feedback to direct where we invest our development time.

Jens, http://www.LunarG.com