Closed gam0022 closed 4 years ago
./glslopt 14:26:25
Usage: glslopt <-f|-v> <input shader> [<output shader>]
-f : fragment shader (default)
-v : vertex shader
-1 : target OpenGL (default)
-2 : target OpenGL ES 2.0
-3 : target OpenGL ES 3.0
If no output specified, output is to [input].out.
./glslopt ~/Dropbox/TDF2020/webpack-tdf2020/src/fragment.glsl output.glsl -3
#version 300 es
precision mediump sampler3D;
precision highp int;
precision highp float;
uniform vec3 iResolution;
uniform float iTime;
out highp vec4 outColor;
void main ()
{
highp vec4 color_1;
highp vec4 tmpvar_2;
tmpvar_2.w = 1.0;
tmpvar_2.xyz = (0.5 + (0.5 * cos(
((iTime + (gl_FragCoord.xy / iResolution.xy).xyx) + vec3(0.0, 2.0, 4.0))
)));
color_1.xyz = tmpvar_2.xyz;
color_1.w = 1.0;
outColor = color_1;
}
435 byte
laurentlb/Shader_Minifier
https://github.com/laurentlb/Shader_Minifier
./glslopt ~/Dropbox/TDF2020/webpack-tdf2020/src/fragment.glsl output.glsl -3
precision highp float;precision highp int;precision mediump sampler3D;
をインジェクトすればコンパイル通る。1116 byte -> 623 byte