Results 1 to 6 of 6

Thread: Questions about VertexBuffers

  1. #1

    Questions about VertexBuffers

    Hi Guys.

    I was wondering... what is the best way to manage your vertexbuffers in your game. How many Should you use to render a scene.

    Here are just a few things you could do:

    1. You can render a scene only using 2 or 3 very large vertexbuffers and put many meshes into one vertexbuffer. You just need to write a system wich manages and manipulates these meshes individualy.

    2. You can give each mesh (like a skybox, a wall, or a character) in your scene its own vertexbuffer.

    3. You can give each mesh more than one vertexbuffer. For example... If you make a robot you can make 6 vertexbuffers for legs, arms, torso and head.

    Ok?© Here are my questions :razz: :

    What is the best way??
    How to get optimal render speed??
    Should i use as less vertexbuffers as possible or not??
    How do you guys do this??

    Thanx in advance...
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Questions about VertexBuffers

    From microsoft:

    http://msdn.microsoft.com/library/de...imizations.asp

    # Minimize vertex buffer switches.
    # Use static vertex buffers where possible.
    # Use one large static vertex buffer per FVF for static objects, rather than one per object.
    NecroSOFT - End of line -

  3. #3

    Questions about VertexBuffers

    Thanx Thats the info i needed.

    So.. It looks like Method 1 is fastest.
    That's great because my engine already supports method 1. Now I use 2 vertexbuffers.
    One for the Console and one for the objects in my scene (so far.. Only a quad and a cube).

    I still wonder what you guys do. :razz:

    @NecroDome: How many vertexbuffer do you use to render SCAG (how many for the enviroment, enemy's, bosses etc... )
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Questions about VertexBuffers

    well, I use method 2.

    Every object has it's own vertex buffer.
    Objects can have a LOD, that has its own vertex buffer. So if you ave an mesh with 3 LOD's, you have 3 vertex buffers for that object.

    Only the *ALL* particles share 1 vertex buffer wich hold only 1 square.

    But it's still fast.
    If you are wondering about the polygon count of my shi[s, it's around 500.
    The orange ship has 800
    World has around 10.000 to 20.000
    NecroSOFT - End of line -

  5. #5

    Questions about VertexBuffers

    Do those SCAG ships realy need different LOD's?? :?
    Even while the models are rendered with an almost constant distance to the camera

    well, I use method 2.
    Anyone using another method??
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Questions about VertexBuffers

    I checked my code again, but I'm only using method 2 for the geometry. Meshes (like the ships and buildings) have per mesh a vertex buffer (and per LOD) but when I want to create 10 ships from the same mesh, it only take 1 vertexbuffer that is render multiple times. It's the same as textuers, load it once and use it as many times as you like.
    I used method 2 befor, but with 500 differnt vertexbuffers it has a slotdown with creating new ones. (and it's also a bit slower with rendering).

    And no, SCAG ships do not have LOD's , the engine was primairly created for a 3D shooter. So was the NecroSPACE 2 engine, but I never made a shooter with it (shame on me). Currenly we are busy to make more maps for SCAG and and if that's is finished, we maybe going to make a racing game or 3D shooter.
    NecroSOFT - End of line -

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •