Skip to content
Minify and obfuscate GLSL or HLSL code
Branch: master
Clone or download
Latest commit 2521c33 Jun 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Checker
lib
src Update test directory Jun 3, 2018
tests Update and fix test cases Jun 3, 2018
.gitattributes
.gitignore
App.config Fix smoothstep optimization trick Dec 2, 2017
LICENSE Add Apache 2.0 License Apr 25, 2017
README.md
Shader Minifier.fsproj Fix warning, cleanup Jun 3, 2018
Shader Minifier.sln
compile.bash merge LLB's sources he sent me by mail Apr 25, 2017
test.bash Some cleanup (e.g. README file). Apr 26, 2017

README.md

Shader Minifier

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:

  • F# 4.0 on Windows (Visual Studio Community 2015)
  • F# 3.0 on Linux and Mono 3.2.8

Slightly outdated user manual: http://www.ctrl-alt-test.fr/?page_id=7

Usage

Download Shader Minifier here: https://github.com/laurentlb/Shader_Minifier/releases

It is a command-line tool. Without argument, it will show the usage. If you are not on Windows, you will need mono:

$ shader_minifier.exe  # Windows
$ mono shader_minifier.exe  # Linux, Mac...

Important options

  • List the shaders you want to minify on the command-line.

  • Use -o to choose the output file (by default, it will use shader_code.h). If you pass - for the output, it will be printed on stdout.

  • Use --format to control the output format. By default, it will create a C header. There are other options to get only the shader, or have it in a .js or nasm file.

  • Use --help to see all the options. You can for example have some control on what gets renamed.

Contributions are welcome.

Created by Laurent Le Brun (LLB / Ctrl-Alt-Test).

http://laurent.le-brun.eu http://ctrl-alt-test.fr

You can’t perform that action at this time.