Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: a big vertex array or a ser of small vertex array?

  1. #1
    Newbie Newbie
    Join Date
    Sep 2013
    Posts
    2

    a big vertex array or a ser of small vertex array?

    *a big vertex array or a set of small vertex array?

    hi all, i'm implementing a LOD mesh and i can store the LODs as indices of a single big vertex array or as a copy of only the used vertices i.e. a set of vertex arrays, the first approach saves a lot of memmory but im not sure it is slower that the second, well , the question : is it slow to use a big vertex array even if there are few indices?
    sorry for my bad english hehe
    Last edited by lovemort; 09-04-2013 at 05:18 PM.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    This is a pretty legitimate question. However, there really is no answer.

    Yes, generally speaking, if you put the LODs in their own memory, the pre-VS caching behavior will be much improved. You won't be jumping around from memory location to memory location as much; every cache line fetch will be important for what you're rendering.

    However, if a single vertex in your vertex format is already at least one cache line in size (32 or possibly 64 bytes, depending on the hardware), then the caching behavior will be irrelevant (unless the hardware implements an L2 cache on the vertex fetching hardware. I have no idea if that's a common practice). So if each vertex is cache-line aligned, each fetch will already be a cache-line fetch. So you wouldn't get much from caching behavior anyway.

    So there's no way to be certain if there is actually any performance difference. You'll have to profile it on your hardware of interest.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    the first approach saves a lot of memory
    Just to be clear here, how much memory are we talking? Assuming a standard 512MB (or possibly even 1GB, depending on your vantage point) of memory, you can push a lot of geometry in there. What is your use case? How much data are you expecting?

  4. #4
    Newbie Newbie
    Join Date
    Sep 2013
    Posts
    2
    thanks for reply, using a single vertex array I have n vertices on memory, if the difference between two contiguous LODs is a single vertex then the second approach requires n + (n-1) + (n-2) + (n-3) +... vertices! when i can have only n ,

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    ... how big is your n ... and how many ns do you have?

Posting Permissions

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