Commit 5875ccb3 authored by Laurent Le Brun's avatar Laurent Le Brun
Browse files


Remove the mess in the readme
parent 5747dc69
Shader Minifier
Shader Minifier is a tool that minifies and obfuscates shader code (GLSL
and HLSL). It's mainly target at demosceners, for writing 4k and 64k
Shader Minifier is a tool that minifies and obfuscates shader code
(GLSL and HLSL). Its original use-case is for the
[demoscene](, for optimizing
4k and 64k intros. It is also suitable for reducing the size of the
shaders in other applications (e.g. webgl, games).
The code is tested with:
This is the initial source release. The code compiles
with F# 2.0 and Visual Studio 2010, and has not been tested with other
The code is a bit messy, and mostly undocumented. Sorry about that. I
wanted to release it anyway by popular demand. I'll try to clean it, but
feel free to contact me if you have any question.
* F# 4.0 on Windows (Visual Studio Community 2015)
* F# 3.0 on Linux and Mono 3.2.8
Slightly outdated user manual:
Some technical details
If I remember correctly, I patched FParsec.dll as it didn't work properly
on Mono because of a bug in Mono (
Because of a bug in F#, I'm targeting .NET 3.5 instead of .NET 4.0. The
bug happens when using at the same time F# powerpack and the --standalone flag.
Those bugs make the release process is a bit messy. I haven't checked
recently, so some of the bugs might have been fixed. For reference, I'll
give the exact command-lines I use (paths have to be updated).
For Windows, I compile with --standalone, targeting .NET 3.5:
"c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o shader_minifier.exe --debug:pdbonly --noframework --define:TRACE --optimize+ -r:D:\Laurent\cat\glsl_minifier\FParsec.dll -r:D:\Laurent\cat\glsl_minifier\FParsecCS.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll" -r:D:\Laurent\cat\glsl_minifier\bin\Release\FSharp.PowerPack.dll -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll --target:exe --warn:3 --warnaserror:76 --LCID:1033 --utf8output --fullpaths --flaterrors --standalone ast.fs printer.fs cGen.fs renamer.fs rewriter.fs parse.fs main.fs
For Linux, I use a newer version of FParsec that I patched manually (some
functions in FParsec have changed, which means I need a different parse.fs
source file too). This newer FParsec version requires .NET 4.0, which is
why I cannot use --standalone and have to ship the dll files separately.
rem "c:\Program Files (x86)\Microsoft F#\v4.0\fsc.exe" -o shader_minifier.exe --debug:pdbonly --noframework --define:TRACE --optimize+ -r:D:\Laurent\cat\glsl_minifier\ -r:D:\Laurent\cat\glsl_minifier\ -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll" -r:D:\Laurent\cat\glsl_minifier\bin\Release\FSharp.PowerPack.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" --target:exe --warn:3 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors "C:\Users\laurent\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.fs" ast.fs printer.fs cGen.fs renamer.fs rewriter.fs main.fs
It would be nice to have a simpler way to release stuff.
Contributions are welcome.
Laurent Le Brun, aka LLB from Ctrl-Alt-Test.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment