简体   繁体   中英

Is it possible to attach textures as render target to the default framebuffer?

Is it possible to attach textures as render target to the default framebuffer?

Ie

    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
    GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1};
    glDrawBuffers(2, bufs);
    glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sceneTexture, 0);
    glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, postProcessingStuffTexture, 0);
    // Draw something

Also why does rendering to texture happen without anit-aliasing? Was pretty happy with my cheap 5xRCSAA or what it was.

Is it possible to attach textures as render target to the default framebuffer?

No.

Also why does rendering to texture happen without anit-aliasing?

Because antialiasing requires a multisample render target. Regular textures are not multisampled. But there are multisample textures which for that purpose. You can create a multisample texture object using glTexStorage2DMultisample or glTexImage2DMultisample .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM