Route thumbnail and node image texture setup through helpers
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user