mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:10:49 +02:00
Playing with mirror
This commit is contained in:
parent
1ddbc15df4
commit
6288e99798
1 changed files with 27 additions and 17 deletions
|
@ -1339,23 +1339,33 @@ void Application::paintGL() {
|
||||||
auto mirrorRectDest = glm::ivec4(mirrorRect.z, mirrorRect.y, mirrorRect.x, mirrorRect.w);
|
auto mirrorRectDest = glm::ivec4(mirrorRect.z, mirrorRect.y, mirrorRect.x, mirrorRect.w);
|
||||||
|
|
||||||
auto primaryFbo = framebufferCache->getPrimaryFramebuffer();
|
auto primaryFbo = framebufferCache->getPrimaryFramebuffer();
|
||||||
/**
|
|
||||||
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
if (renderArgs._renderMode == RenderArgs::MIRROR_RENDER_MODE) {
|
||||||
batch.setFramebuffer(finalFramebuffer);
|
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
||||||
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
gpu::Vec4i srcRect;
|
||||||
batch.blit(primaryFbo, mirrorRect, finalFramebuffer, mirrorRectDest);
|
srcRect.z = size.width();
|
||||||
batch.setFramebuffer(nullptr);
|
srcRect.w = size.height();
|
||||||
});
|
gpu::Vec4i destRect;
|
||||||
*/
|
destRect.x = size.width();
|
||||||
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
destRect.y = 0;
|
||||||
gpu::Vec4i rect;
|
destRect.z = 0;
|
||||||
rect.z = size.width();
|
destRect.w = size.height();
|
||||||
rect.w = size.height();
|
batch.setFramebuffer(finalFramebuffer);
|
||||||
batch.setFramebuffer(finalFramebuffer);
|
// batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
batch.blit(primaryFbo, srcRect, finalFramebuffer, destRect);
|
||||||
batch.blit(primaryFbo, rect, finalFramebuffer, rect);
|
// batch.setFramebuffer(nullptr);
|
||||||
// batch.setFramebuffer(nullptr);
|
});
|
||||||
});
|
} else {
|
||||||
|
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
||||||
|
gpu::Vec4i rect;
|
||||||
|
rect.z = size.width();
|
||||||
|
rect.w = size.height();
|
||||||
|
batch.setFramebuffer(finalFramebuffer);
|
||||||
|
// batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
batch.blit(primaryFbo, rect, finalFramebuffer, rect);
|
||||||
|
// batch.setFramebuffer(nullptr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue