Ejemplo n.º 1
0
void SceneRenderer::downsampleSceneDepth(const MatrixStorage& mats, NvSimpleFBO *srcFbo, NvWritableFB *dstFbo)
{
    glBindFramebuffer(GL_READ_FRAMEBUFFER, srcFbo->fbo);        CHECK_GL_ERROR();
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dstFbo->fbo);        CHECK_GL_ERROR();

    glBlitFramebufferFunc(0, 0, srcFbo->width, srcFbo->height,
                        0, 0, dstFbo->width, dstFbo->height,
                        GL_DEPTH_BUFFER_BIT, GL_NEAREST);        CHECK_GL_ERROR();
}
Ejemplo n.º 2
0
void Upsampler::upsampleSceneColors(NvWritableFB& target)
{
    if (m_params.useBlit && glBlitFramebufferFunc)
    {
        const NvSimpleFBO *srcFbo = m_fbos->m_sceneFbo;
        glBindFramebuffer(GL_READ_FRAMEBUFFER, srcFbo->fbo);
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target.fbo);

        glBlitFramebufferFunc(0, 0, srcFbo->width, srcFbo->height,
                            0, 0, target.width, target.height,
                            GL_COLOR_BUFFER_BIT, GL_LINEAR);
    }
    else
    {
        glBindFramebuffer(GL_FRAMEBUFFER, target.fbo);
        glViewport(0, 0, target.width, target.height);

        drawBilinearUpsampling(m_upsampleBilinearProg, m_fbos->m_sceneFbo->colorTexture);
    }
}