fix stencil random every stroke and not sample

This commit is contained in:
2018-05-10 22:35:59 +02:00
parent 2379679913
commit 2a728b3a07
3 changed files with 5 additions and 2 deletions

View File

@@ -335,7 +335,7 @@ void App::initShaders()
//"highp float rand(mediump vec2 co) { return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); }\n"
"void main(){\n"
" mediump vec2 uv2 = gl_FragCoord.st / resolution;\n"
" mediump float stencil = 1.0 - (texture(tex_stencil, (uv2+stencil_offset) * 2.0).r * 0.9) * stencil_alpha;\n"
" mediump float stencil = 1.0 - (texture(tex_stencil, (uv2+stencil_offset) * 5.0).r) * stencil_alpha;\n"
" mediump float brush_alpha = ( 1.0 - texture(tex, uv/q).r ) * alpha;\n"
" mediump vec4 fg = vec4(col.rgb, brush_alpha * stencil);\n"
#ifdef __IOS__