Skip to content

Instantly share code, notes, and snippets.

@0b5vr
Created September 7, 2023 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0b5vr/843fffdec25b00d499d994bd406af0f9 to your computer and use it in GitHub Desktop.
Save 0b5vr/843fffdec25b00d499d994bd406af0f9 to your computer and use it in GitHub Desktop.
Minification result of MinimalGL default shader
rem based on minify.bat
"C:\Users\0b5vr\Documents\Workspace\minimal_gl\x64\Release\shader_minifier.exe" graphics_fragment_shader.i -o graphics_fragment_shader.inl --format c-array || exit /b 5
/* File generated with Shader Minifier 1.2
* http://www.ctrl-alt-test.fr
*/
# define VAR_G_VEC4OUTCOLOR "e"
# define VAR_G_WAVEOUTPOS "v"
// graphics_fragment_shader.i
"#version 430\n"
"layout(std430,binding=0)buffer _{vec2 i[];};"
"layout(location=0)uniform int v;"
"vec2 g={1280,720};"
"out vec4 e;"
"float x=v/48000.;"
"void main()"
"{"
"vec3 d=vec3(0);"
"int y=v+int(gl_FragCoord.x),n=v+int(gl_FragCoord.x)+1,a=int((i[y].x*.5+.5)*(g.y-1.)+.5),l=int((i[y].y*.5+.5)*(g.y-1.)+.5),s=int((i[n].x*.5+.5)*(g.y-1.)+.5),b=int((i[n].y*.5+.5)*(g.y-1.)+.5),o=int(gl_FragCoord.y);"
"if(a>s)"
"if(a>=o&&o>=s)"
"d.x=1;"
"else"
" if(a<=o&&o<=s)"
"d.x=1;"
"if(l>b)"
"if(l>=o&&o>=b)"
"d.y=1;"
"else"
" if(l<=o&&o<=b)"
"d.y=1;"
"d+=(abs(i[y].x)+abs(i[y].y))*vec3(.1,.1,.7);"
"d+=sin(vec3(3,5,0)*.2*x)*.1+.1;"
"e=vec4(d,1);"
"}"
// Generated with Shader Minifier 1.3.6 (https://github.com/laurentlb/Shader_Minifier/)
#ifndef SHADER_MINIFIER_IMPL
#ifndef SHADER_MINIFIER_HEADER
# define SHADER_MINIFIER_HEADER
# define VAR_g_vec4OutColor "v"
# define VAR_g_waveOutPos "i"
#endif
#else // if SHADER_MINIFIER_IMPL
// graphics_fragment_shader.i
"#version 430\n"
"layout(std430,binding=0)buffer _{vec2 g[];};"
"layout(location=0) uniform int i;"
"vec2 d={1280,720};"
"out vec4 v;"
"float x=i/4.8e4;"
"void main()"
"{"
"vec3 w=vec3(0);"
"int y=i+int(gl_FragCoord.x),b=i+int(gl_FragCoord.x)+1,a=int((g[y].x*.5+.5)*(d.y-1.)+.5),l=int((g[y].y*.5+.5)*(d.y-1.)+.5),n=int((g[b].x*.5+.5)*(d.y-1.)+.5),s=int((g[b].y*.5+.5)*(d.y-1.)+.5),C=int(gl_FragCoord.y);"
"if(a>n)"
"{"
"if(a>=C&&C>=n)"
"w.x=1;"
"}"
"else if(a<=C&&C<=n)"
"w.x=1;"
"if(l>s)"
"{"
"if(l>=C&&C>=s)"
"w.y=1;"
"}"
"else if(l<=C&&C<=s)"
"w.y=1;"
"w+=(abs(g[y].x)+abs(g[y].y))*vec3(.1,.1,.7);"
"w+=sin(vec3(3,5,0)*.2*x)*.1+.1;"
"v=vec4(w,1);"
"}"
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment