Route NodeCanvas blend setup through helper

This commit is contained in:
2026-06-13 05:10:37 +02:00
parent 93488d0790
commit ea1557f7ea
4 changed files with 51 additions and 7 deletions

View File

@@ -606,13 +606,15 @@ void NodeCanvas::draw()
m_sampler.bind(0);
m_sampler.bind(2);
ShaderManager::use(kShader::TextureBlend);
ShaderManager::u_int(kShaderUniform::Tex, 0);
if (copy_blend_destination)
ShaderManager::u_int(kShaderUniform::TexBG, 2);
ShaderManager::u_int(kShaderUniform::BlendMode, m_canvas->m_layers[layer_index]->m_blend_mode);
ShaderManager::u_float(kShaderUniform::Alpha, 1.f);
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-1, 1, -1, 1));
pp::panopainter::setup_legacy_canvas_draw_merge_texture_blend_shader(
pp::panopainter::LegacyCanvasDrawMergeTextureBlendUniforms {
.mvp = glm::ortho(-1, 1, -1, 1),
.texture_slot = 0,
.destination_texture_slot = 2,
.use_destination_texture = copy_blend_destination,
.blend_mode = m_canvas->m_layers[layer_index]->m_blend_mode,
.alpha = 1.f,
});
set_active_texture_unit(0);
m_blender_rtt.bindTexture();