Route thumbnail and node image texture setup through helpers

This commit is contained in:
2026-06-13 05:34:28 +02:00
parent ed05ba453e
commit bb05fac00f
5 changed files with 32 additions and 11 deletions

View File

@@ -3031,15 +3031,19 @@ Image Canvas::thumbnail_generate(int w, int h)
copy_framebuffer_to_texture_2d(0, 0, 0, 0, w, h);
// draw the grid
ShaderManager::use(kShader::Checkerboard);
ShaderManager::u_mat4(kShaderUniform::MVP, plane_mvp);
pp::panopainter::setup_legacy_canvas_draw_merge_checkerboard_shader(
pp::panopainter::LegacyCanvasDrawMergeCheckerboardUniforms {
.mvp = plane_mvp,
});
m_face_plane.draw_fill();
// now blend with the background
apply_canvas_capability(blend_state(), true);
ShaderManager::use(kShader::Texture);
ShaderManager::u_int(kShaderUniform::Tex, 0);
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f));
pp::panopainter::setup_legacy_canvas_draw_merge_texture_shader(
pp::panopainter::LegacyCanvasDrawMergeTextureUniforms {
.mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f),
.texture_slot = 0,
});
m_sampler.bind(0); // linear
m_plane.draw_fill();