Zyl
Zyl

Reputation: 3270

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?

I.e.

    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.

Upvotes: 1

Views: 564

Answers (1)

datenwolf
datenwolf

Reputation: 162164

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.

Upvotes: 3

Related Questions