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 8819131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:16:39+00:00 2026-06-14T05:16:39+00:00

Imagine a typical game where objects in the simulated world are created and destroyed.

  • 0

Imagine a typical game where objects in the simulated world are created and destroyed. When these objects are created, their vertex data is stored in a VBO. This VBO is rendered once per frame.

Is there a best practice for dealing with dead objects? I.e. when the object is destroyed and thus no longer needs to be rendered, what should happen to its corresponding VBO data?

It seems like you’d want to “free” that memory up for future use by other objects. Otherwise, your VBO would eventually be filled almost entirely with dead data.

I have one possible idea for implementing this: a map of VBO memory wherein individual bytes are marked as free or in use. (This map would live on the CPU as a normal array, not on the GPU.) When an object is created, we buffer its data to a free region as determined by the map. We mark that region as used on the map. Then when the object is destroyed, we mark that same region as free. I’m thinking you would store the map either as an array of booleans if you’re lazy, or pack it in as one map bit per VBO byte if you want to do it right.

So far, does this sound like the best approach? Is there a more common approach that I’m not seeing?

I know a lot of these questions hinge on the characteristics of the scene you’re rendering, so here’s the context. My scene consists of several hundred objects. Each object has about eight vertices. Each vertex has a position and texture coordinate stored as floats. So, we’re looking at approximately:

4 bytes per float * 6 floats per vert * 8 verts per object * 500 objects
= 96,000 bytes of vertex data
  • 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-06-14T05:16:40+00:00Added an answer on June 14, 2026 at 5:16 am

    Sounds like you’re thinking of using a pool allocator. There’s a lot of existing work done on those, which should apply quite well to allocations inside a VBO also.

    It will be pretty straightforward if all elements are the same size. Otherwise, you need to be concerned about fragmentation, but heap managers are quite well known.

    The simplest improvement I would offer is to start your scan for a free slot from the last slot filled, instead of always from the beginning.

    You can trade space for speed by using a deque-style data structure to store a list of free locations, which eliminates the need to scan for a free spot.

    The size of the data stored in the VBO really has no impact on the manager. Only the number of slots which can be invididually repurposed.

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

Sidebar

Related Questions

Imagine a typical CakePHP application, in which a Controller passes various bits of data
I'm facing kind of typical issue. Imagine typical 1-N relationship between objects. To be
Imagine the typical type of application where you have a list of items with
imagine this html on a page <div id=hpl_content_wrap> <p class=foobar>this is one word and
Imagine I've got a database with lots of data, from which users can search.
Imagine a very big gwt project of application. This is just a some form
Imagine your typical manager / employee hierarchy, where you have an employee with a
I'm writing a stored procedure. This procedure has a case where if it is
Ok, imagine a typical scenario, - there is a thread object and comments, attached
Imagine I have a service that looks like this: public interface MyAccountService { boolean

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.