We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input shader
varying vec2 v_texcoordOut; uniform sampler2D s_texture; uniform float u_degree; uniform float u_degree2; void main(void) { vec2 texcoord = v_texcoordOut; if(u_degree > 0.001) { if(u_degree2 > 0.8) { texcoord.x += 0.1; } else if(u_degree2 >0.5) { texcoord.y += 0.1; } } gl_FragColor = texture2D(s_texture, texcoord); }
after command
mono "$script_dir/shader_minifier.exe" -v --preserve-externals --field-names stpq -o res.h input.frag
// Generated with Shader Minifier 1.3.6 (https://github.com/laurentlb/Shader_Minifier/) #ifndef RES_H_ # define RES_H_ const char *Basic_frag = "precision highp float;varying vec2 v_texcoordOut;" "uniform sampler2D s_texture;" "uniform float u_degree,u_degree2;" "void main()" "{" "vec2 f=v_texcoordOut;" "if(u_degree>.001)" "if(u_degree2>.8)" "f.s+=.1;" "else if(u_degree2>.5)" "f.t+=.1;" "gl_FragColor=texture2D(s_texture,f);" "}"; #endif // RES_H_
missing scrope in ""if(u_degree>.001)""
The text was updated successfully, but these errors were encountered:
I think the output is correct, the curly braces are not needed here.
Sorry, something went wrong.
Some machines produce compilation errors because of this approach
Can you give more information on your setup? What tool is compiling the code? Have you considered filing a bug against that tool?
As far as I can tell, the syntax is not ambiguous, it's properly defined in the spec (at least for GLSL).
No branches or pull requests
input shader
after command
mono "$script_dir/shader_minifier.exe" -v --preserve-externals --field-names stpq -o res.h input.frag
missing scrope in ""if(u_degree>.001)""
The text was updated successfully, but these errors were encountered: