fix stroke shader with better blending and initial support to opacity

This commit is contained in:
2017-04-07 01:45:50 +01:00
parent 4d930b4429
commit d340324c3d
4 changed files with 34 additions and 14 deletions

View File

@@ -1872,7 +1872,7 @@ public:
glGetIntegerv(GL_VIEWPORT, vp);
glGetFloatv(GL_COLOR_CLEAR_VALUE, cc);
glClearColor(0, 0, 0, 1);
glClearColor(1, 1, 1, 1);
glClear(GL_COLOR_BUFFER_BIT);
float zoom = root()->m_zoom;
auto box = m_clip * zoom;
@@ -1901,6 +1901,10 @@ public:
if (m_canvas->m_show_tmp)
{
glEnable(GL_BLEND);
ui::ShaderManager::use(kShader::TextureAlpha);
ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
ui::ShaderManager::u_mat4(kShaderUniform::MVP, mvp);
ui::ShaderManager::u_float(kShaderUniform::Alpha, .5);
m_canvas->m_tmp.bindTexture();
NodeBorder::m_plane.draw_fill();
m_canvas->m_tmp.unbindTexture();