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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:14:08+00:00 2026-05-30T18:14:08+00:00

I’ve made a small 3D viewer application using DirectX 9.0. Now I would like

  • 0

I’ve made a small 3D viewer application using DirectX 9.0. Now I would like to add some editing functionality. Suppose that I want to edit a large polygon. While the user edits the shape, vertices would be added, deleted and moved. Right now each polygon is stored as a vertex buffer.
My question is, what is the best way to store and display the shape while the user edits it? If i destroy and re-create the vertex buffer each time a change happens, I believe it will be too resource intensive and suboptimal.

I though I should ask my questions in the main post as well so here they are :

I have three different tasks, two of which I don’t know how to implement :
1) Editing a vertex : Easy, I will just update the old vertex with the new position in the VB.
2) Deleting a vertex : What happens here? How do I remove it without creating a new VB? Should I just add a blank VB?
3) Adding a vertex : What about here? Can I change the length of a dynamic VB and add vertices at the end?

Another thought here that I believe would work :
1) Editing is easy
2) Deleting would just mean that I will overwrite the deleted vertex with possibly the position of the previous or the next vertex, so it will not be visible.
3) Addition will create a new vertex buffer, but will resize like a Vector or a List. Each time it’s re-created it’s size would be something like
NewSize = OldSize * 1.1 (adding 10% more)
so that successive additions do not have to re-create the VB.
So 1 & 2 never create a new VB and 3 might sometimes create one. How does this sound?

  • 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-30T18:14:08+00:00Added an answer on May 30, 2026 at 6:14 pm

    You don’t have to destroy the buffer every frame. Create a dynamic buffer.

    Check out the article Using Vertex Buffers With DirectX, if you haven’t already:

    For dynamic vertex buffers, which contain information about primitives that change often in the scene, we need to specify the D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY flags for the Usage and the D3DPOOL_DEFAULT flag for the Pool.

    Remember though, the data still has to be sent to the pipeline for every update. So there will definitely be some performance cost compared to static buffers with consistent data.

    Also you should really try keeping buffer updates and also buffer switches to a minimum. Are there many such editable polygons in your application? If the answer is yes, maybe consider putting them into one buffer.


    The official Q/A site for graphics/game developers: https://gamedev.stackexchange.com/


    Update

    Sounds pretty good to me.

    Dynamic Vertex Buffers, on the other hand, are filled and tossed away every frame.

    This is taken from the article and is pretty much the answer for 1. and 2.. Instead of updating single vertices or carefully selecting which of them should be overwritten I would just update the whole buffer content. The complete buffer has to be sent to the device anyways. You would have to test it though, just to be sure.

    Concerning 3.: You cannot change the buffer’s size after it has been created, but you can create a larger buffer than actually needed. So try to estimate a good margin. If the buffer is still too small you will have to create a new one. There is no other solution to this. You have already found a possible algorythm for increasing the buffer size dynamically.

    There are so many parameters when it comes to graphics performance, it is nearly impossible to give definite answers. Are you already encountering limits? If not, do not bother too much. Be generous with your resources while you are still developing.

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.