layer highlight when selected

This commit is contained in:
2017-08-11 19:07:48 +01:00
parent 9be2e8e147
commit 10fecd46b0
8 changed files with 59 additions and 21 deletions

View File

@@ -38,10 +38,14 @@ void App::initShaders()
SHADER_VERSION
"uniform sampler2D tex;\n"
"uniform mediump float alpha;\n"
"uniform bool highlight;\n"
"in mediump vec3 uv;\n"
"out mediump vec4 frag;\n"
"void main(){\n"
" frag = texture(tex, uv.xy) * vec4(1,1,1,alpha);\n"
" mediump vec4 c = texture(tex, uv.xy);\n"
" frag = highlight ? \n"
" vec4(clamp(vec3(.3)+c.rgb, vec3(0), vec3(1)), c.a) : \n"
" texture(tex, uv.xy) * vec4(1,1,1,alpha);\n"
"}\n";
// TEXTURE COMP ERASE
static const char* shader_comp_erase_f =