Forums - glBlitFramebuffer and multisample resolves

3 posts / 0 new
Last post
glBlitFramebuffer and multisample resolves
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Mon, 2015-01-19 13:35

 

While working with glBlitFramebuffer I saw that it doesn't resolve the depth samples, as in calling a glBlitFramebuffer with a read FBO with a depth renderbuffer with samples = 4 never makes any writes into my depth texture.

 

Then I read this part of the OpenGL ES 3.0 spec that says :

 

"If the value of SAMPLE_BUFFERS for the read framebuffer is one and the value

of SAMPLE_BUFFERS for the draw framebuffer is zero, the samples corresponding

to each pixel location in the source are converted to a single sample before being

written to the destination. The filter parameter is ignored.. If the source formats are depth values, sample values are resolved in an implementationdependent

manner where the result will be between the minimum and maximum depth values in the pixel."

 

This explicitly says that the depth must be resolved to be between the minimum and maximum of all the samples for a pixel. This must mean that the depth should be resolved in some way and I should have a resolved depth texture, yet I don't.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2015-01-20 07:50

Need to get a bit more information...

1) Can you provide some psuedocode showing the calls you are making to set up the FBO and renderbuffers, doing the attachment, and drawing?

2) Have you checked for completeness?

3) Is nothing being written to the depth texture?  Is there any glerror generated?

4) Which hardware/driver are you experiencing the problem on?

5) As per: https://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml

If SAMPLE_BUFFERS for the read framebuffer is greater than zero and SAMPLE_BUFFERS for the draw framebuffer is zero, the samples corresponding to each pixel location in the source are converted to a single sample before being written to the destination.

 

thanks..

  • Up0
  • Down0
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Tue, 2015-01-20 19:12

 

Actually, after working on a lot more things I came to discover a way to make it work.

I just discovered yesterday that sized depth textures (GL_DEPTH_COMPONENT16/24/32) need to have GL_NEAREST for the filtering parameters.

Now, the thing is that if you use GL_DEPTH_COMPONENT32 it seems to resolve the depth buffer if you filtering with GL_NEAREST but the resolved color buffer doesn't appear to be antialiased, it looks exactly as if you rendered without multisampling . And I just tried using GL_DEPTH_COMPONENT24 for the heck of it and that resolves depth as well as color ! I was previously just using the GLES2 GL_DEPTH_COMPONENT for internalformat because I didn't knew about needing to set GL_NEAREST for all filters.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.