Exemplo n.º 1
0
void FECustomFilter::drawFilterMesh(Platform3DObject inputTexture)
{
    bool multisample = canUseMultisampleBuffers();
    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, multisample ? m_multisampleFrameBuffer : m_frameBuffer);
    m_context->viewport(0, 0, m_contextSize.width(), m_contextSize.height());

    m_context->clearColor(0, 0, 0, 0);
    m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::DEPTH_BUFFER_BIT);

    m_customFilterRenderer->draw(inputTexture, m_contextSize);

    if (multisample)
        resolveMultisampleBuffer();
}
Exemplo n.º 2
0
void FECustomFilter::drawFilterMesh(Platform3DObject inputTexture)
{
    bool multisample = canUseMultisampleBuffers();
    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, multisample ? m_multisampleFrameBuffer : m_frameBuffer);
    m_context->viewport(0, 0, m_contextSize.width(), m_contextSize.height());

    m_context->clearColor(0, 0, 0, 0);
    m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::DEPTH_BUFFER_BIT);

    bindProgramAndBuffers(inputTexture);
    m_context->drawElements(GraphicsContext3D::TRIANGLES, m_mesh->indicesCount(), GraphicsContext3D::UNSIGNED_SHORT, 0);
    unbindVertexAttributes();

    if (multisample)
        resolveMultisampleBuffer();
}