implement stencil from file
This commit is contained in:
@@ -290,7 +290,7 @@ void Canvas::stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2& bb_sz)
|
||||
m_sampler.bind(0);
|
||||
m_sampler.bind(1);
|
||||
m_sampler.bind(2);
|
||||
auto& paper = TextureManager::get(const_hash("data/paper.jpg"));
|
||||
auto& paper = TextureManager::get(m_current_stroke->m_brush.m_tex_stencil_id);
|
||||
ShaderManager::use(kShader::CompDraw);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
//ShaderManager::u_int(kShaderUniform::TexA, 0);
|
||||
@@ -346,7 +346,7 @@ void Canvas::stroke_draw()
|
||||
auto m_brush = m_current_stroke->m_brush;
|
||||
auto samples = m_current_stroke->compute_samples();
|
||||
auto& tex = TextureManager::get(m_brush.m_tex_id);
|
||||
auto& stencil = TextureManager::get(const_hash("data/paper.jpg"));
|
||||
auto& stencil = TextureManager::get(m_brush.m_tex_stencil_id);
|
||||
auto ortho_proj = glm::ortho(0.f, (float)m_width, 0.f, (float)m_height, -1.f, 1.f);
|
||||
|
||||
std::vector<vertex_t> B{
|
||||
@@ -832,7 +832,7 @@ void Canvas::stroke_commit()
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& paper = TextureManager::get(const_hash("data/paper.jpg"));
|
||||
auto& paper = TextureManager::get(m_current_stroke->m_brush.m_tex_stencil_id);
|
||||
|
||||
ShaderManager::use(kShader::CompDraw);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
|
||||
Reference in New Issue
Block a user