implement brush outline
This commit is contained in:
@@ -161,7 +161,15 @@ void App::initShaders()
|
||||
"out mediump vec4 frag;\n"
|
||||
"void main() {\n"
|
||||
" mediump float stroke = 1.0 - texture(tex, uv).r;\n"
|
||||
" frag = vec4(col.rgb, stroke * alpha);\n"
|
||||
" int zero_count = 0;\n"
|
||||
" for (int x = -1; x <= 1; x++){\n"
|
||||
" for (int y = -1; y <= 1; y++){\n"
|
||||
" if (textureOffset(tex, uv, ivec2(x, y)).r == 1.0) \n"
|
||||
" zero_count++;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" float edge = (zero_count > 1 && zero_count < 9) ? 0.75 : 0.0;\n"
|
||||
" frag = vec4(col.rgb, edge);\n"
|
||||
"}\n";
|
||||
// TEXTURE COMP ERASE
|
||||
static const char* shader_comp_erase_f =
|
||||
|
||||
Reference in New Issue
Block a user