version 1.2.0

fixed framebuffer size feature
This commit is contained in:
2023-05-17 15:58:39 +03:00
parent 484a7f972f
commit 292f68a574
15 changed files with 73 additions and 23 deletions

View File

@@ -129,7 +129,7 @@ void RendererSelection::renderSelection(Scene & scene) {
fbo_selection.setWriteBuffers();
glEnableDepth();
glClearFramebuffer(QColor(0, 0, 0, 0));
r->setUniformCamera(prog, view->camera());
r->setUniformCamera(prog, view->camera(), true, r->fbo_ds.size());
r->renderObjects(scene, rpSolid);
r->renderObjects(scene, rpTransparent);
view->glClear(GL_DEPTH_BUFFER_BIT);
@@ -138,10 +138,12 @@ void RendererSelection::renderSelection(Scene & scene) {
rs.drawLights();
rs.drawCameras();
rs.drawCurrentHandleObjects();
auto mapPoint = [this](QPoint p) { return (QPointF(p.x() * size_coeff.x(), p.y() * size_coeff.y()) * scale_).toPoint(); };
auto mapSize = [this](QSize s) { return (QSizeF(s.width() * size_coeff.x(), s.height() * size_coeff.y()) * scale_).toSize(); };
if (r->mouse_rect.isNull())
fbo_selection.queryPoint(0, r->mouse_pos * scale_);
fbo_selection.queryPoint(0, mapPoint(r->mouse_pos));
else
fbo_selection.queryPoints(0, QRect(r->mouse_rect.topLeft() * scale_, r->mouse_rect.size() * scale_));
fbo_selection.queryPoints(0, QRect(mapPoint(r->mouse_rect.topLeft()), mapSize(r->mouse_rect.size())));
// qDebug() << id_hover;
fbo_selection.bindColorTexture(sbrSrcHover, sbrSrcHover);