I’ve just released Shader Minifier 1.1. You can download the binary at the usual place.
- New output options: use
--format c-arrayto get a comma-separated list of strings (to be included in a C array).
- Use the new option
--no-renaming-listif there are identifiers you don’t want to get renamed (e.g. entry point functions in HLSL)
- If you have #define macros, Shader Minifier will now avoid conflicts between macros and identifier renaming.
- If your code has conditions with compile-time known values, they will get simplified (e.g.
if (false), or
int i_tag = 2; if (i_tag < 4) ...).
- If there are many identifiers in your code (this probably won’t happen in a 4k intro), Minifier will now use 2-letter names if needed. This is not correctly optimized, but some people use this tool for obfuscation, instead of size-optimization.
- The option
--preserve-all-globalswon’t rename any global variable or any function. This is useful if your shader is split between multiple files.
- You can now tell the Minifier not to parse some block of code. Put your code between
//]and it won’t be parsed, identifiers won’t be renamed, but spaces and comments will still be removed. This is very useful if you want to use features not yet supported in the tool (e.g. forward declarations, or layouts).
- Other fixes in the parser (macros can be used in a function block, numbers can have suffixes, etc.)
- Unix support. Use this zip file instead of the standard release, install a recent version of Mono (at least 2.10) and run
mono shader_minifier.exe. This should work.
- Online Minifier. You can use shader minifier online, but only one shader at a time.
Who is using it?
During the last year, many great intros have used it with great success.