Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:52:09+00:00 2026-05-26T21:52:09+00:00

I want to use a sub-sampled depth buffer to increase performance of a program.

  • 0

I want to use a sub-sampled depth buffer to increase performance of a program. In my case, it does not matter if there are artifacts or geometry popping will occur.

I have set up my framebuffer like this:

// Color attachment
glBindTexture(GL_TEXTURE_2D, colorAttachment);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 640, 360, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);

// Depth attachment
glBindRenderbuffer(GL_RENDERBUFFER, depthAttachment);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, 160, 90);

// Framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorAttachment, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthAttachment);

However, now, glCheckFramebufferStatus(GL_FRAMEBUFFER) returns GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS which stands for “Not all attached images have the same width and height” according to the documentation.

There exists a research paper called “Full-3D Edge Tracking with a Particle Filter” which describes in section 3.5 that they actually used a sub-sampled depth buffer to increase the performance in their application.

Sub-sampled depth buffer: Adjacent pixels along an image edge are so closely correlated
that testing each individual edge pixel is redundant. For single-hypothesis trackers,
it is common to spread sample points a distance of 10-20 pixels apart along an edge.
Sampling only every nth edge pixel also reduces the graphics bandwidth required and
so only every 4th pixel is sampled. Instead of explicitly drawing stippled lines, this is here achieved by using a sub-sampled depth buffer (160 x 120) since this further achieves
a bandwidth reduction for clearing and populating the depth buffer. However, this also
means that hidden line removal can be inaccurate to approximately four pixels. Apart
from this, the accuracy of the system is unaffected.

The only workarounds which are obvious are

  • Using a fragment shader program to perform the lookup into the previously rendered depth buffer to apply the depth-check manually.
  • Rendering the depthbuffer in the lower resolution, then resample it to the bigger resolution, then use it as before.

Both approaches don’t sound like they would be the most performant ideas. What is the cleanest way to achieve a sub-sampled depth buffer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:52:09+00:00Added an answer on May 26, 2026 at 9:52 pm

    The doc page you referenced refers to OpenGL ES 1.0 and 2.0. The OpenGL wiki has more information as to the difference between 2.0 and 3.0, namely that starting with 3.0 (and ARB_framebuffer_object), framebuffer textures can be of different sizes. However, if I recall correctly, when you have textures of different sizes attached, the actual texture size used is the intersection of all FBO attached textures. I don’t think this is what you want.

    In order to reduce the size of your depth texture, I suggest using glBlitFramebuffer to transform your large texture into a smaller one. This operation is completely done on the GPU so it’s very fast. The final smaller texture can then be used as input for further rendering operations in your shaders which will definitely provide bandwidth savings. Instead of performing the averaging of multiple depth values for each pixel shader execution, it will be done once per texel in the smaller texture. A smaller texture is also inherently faster to sample since it fits in cache better.

    Keep in ming however that averaging depth samples can produce wild inaccuracies because the depth values are not linearly spread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom
I want to learn about how to use sub reports in RDLC in ASP.Net.
In order to clean up my code i want to use sub-plugins within my
I have a template that includes several tables. I want to use a sub-template
I am relatively new to Perl and I do not want to use the
I want to use a Dictionary(Of Key, Value), and the Key is not a
I want use groovy findAll with my param to filtering closure filterClosure = {
i want use some data from a website with web service. i have a
I have a transaction log file in CSV format that I want use to
Below is my stored procedure. I want use stored procedure select all row of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.