improve termination sequence on windows, use patterns instead of textures as directory name

This commit is contained in:
2019-02-20 11:48:17 +01:00
parent 7faab0124d
commit 033c39aef5
8 changed files with 81 additions and 58 deletions

View File

@@ -35,7 +35,7 @@
" else if (mode == 2) return vec4(blend_screen(base, stroke, alpha_tot), alpha_tot);\n"\
" else if (mode == 3) return vec4(blend_colorDodge(base, stroke, alpha_tot), alpha_tot);\n"\
" else if (mode == 4) return vec4(blend_overlay(base, stroke, alpha_tot), alpha_tot);\n"\
" else return vec4(1, 0, 0, 1);\n"\
" else return vec4(1.0, 0.0, 0.0, 1.0);\n"\
"}\n"
#define SHADER_FUNCTION_BLEND_STROKE \
@@ -45,7 +45,7 @@
" else if (mode == 2) return 1.0-(1.0-base)*(1.0-stroke);\n"\
" else if (mode == 3) return base/(1.0-stroke);\n"\
" else if (mode == 4) return mix(2.0*base*stroke, 1.0-2.0*(1.0-base)*(1.0-stroke), floor(base*2.0));\n"\
" else return 1;\n"\
" else return 1.0;\n"\
"}\n"
#define SHADER_FUNCTION_HSV \
@@ -88,8 +88,8 @@
" highp float a = 12.9898;\n"\
" highp float b = 78.233;\n"\
" highp float c = 43758.5453;\n"\
" highp float dt= dot(co.xy ,vec2(a,b));\n"\
" highp float sn= mod(dt,3.14);\n"\
" highp float dt= dot(co.xy, vec2(a,b));\n"\
" highp float sn= mod(dt, 3.14);\n"\
" return fract(sin(sn) * c);\n"\
"}\n"
@@ -218,16 +218,14 @@ void App::initShaders()
"uniform mediump float alpha;\n"
"uniform mediump float stroke_alpha;\n"
"uniform mediump vec2 resolution;\n"
"uniform bool fragUV2;\n"
"uniform bool mask;\n"
"in mediump vec2 uv;\n"
"out mediump vec4 frag;\n"
SHADER_FUNCTION_BLUR
"void main() {\n"
" mediump vec2 uv2 = fragUV2 ? (gl_FragCoord.st / resolution) : uv;\n"
" mediump vec4 base = texture(tex, uv2);\n"
" mediump vec4 base = texture(tex, uv);\n"
" mediump vec4 stroke = texture(tex_stroke, uv);\n"
" stroke.a = mask ? stroke.a * stroke_alpha * blur(tex_mask, uv2).r : stroke.a * stroke_alpha;\n"
" stroke.a = mask ? stroke.a * stroke_alpha * blur(tex_mask, uv).r : stroke.a * stroke_alpha;\n"
" frag = vec4(base.rgb, clamp((base.a - stroke.a) * alpha, 0.0, 1.0));\n"
"}\n";
// TEXTURE COMP DRAW