glResolveMultisampleFramebufferAPPLE copying depth buffer

This topic contains 1 reply, has 2 voices, and was last updated by  Tobias Hector 4 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #31166

    nickb
    Member

    Hiya,
    I’m trying to use glResolveMultisampleFramebufferAPPLE on iOS to copy a one framebuffer object to another. I also want to copy the depth buffer into a texture. Is this possible?
    I’m copying from a multisampled FBO, in my read FBO I have a texture attached for both the colour attachment and the depth buffer, it doesn’t flag any errors after the resolve and I get the color copied but not the depth.
    I’m trying to do a depth of field affect, I managed it on windows with a glBlitFramebuffer. Any ideas how I could achieve that on iOS?
    Cheers,
    Nick

    #36757

    Hi Nick,

    As far as I can tell from the specification, this isn’t possible, at least not easily, as the resolve operation only affects colour data. Unfortunately you also can’t attach a non-multisampled depth texture to a multi-sampled framebuffer, and nor can you create a multisampled depth texture, which rules both of these options for working around the limitations.

    So unless you have a spare channel in your colour texture, you’re likely to have to do a second render with the same data, and write the value of “glFragCoord.z” to your colour output, then do a resolve on that. If you do have a spare channel, you can just do this as part of your main render – typically this can be written into the alpha channel if you are doing an opaque render, for example.

    If you do have to do a second render, it’s going to be a fairly expensive operation unfortunately, so you may want to look at alternative methods of achieving your effects; but this should work for most cases.

    Thanks,
    Tobias

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.