Vertex Caching
Hi all!
I want to use vertex caching with opengl. I want to calculate the vertex values (such as position, color, ...) before drawing them with a primitive (for example for meshes). If I''m using vertex arrays the vertex values are calculated when using the glDraw* commands, aren''t they? But how can I calculate them before use?
Thanks for each answer!
Corrail
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
quote:
If I''m using vertex arrays the vertex values are calculated when using the glDraw* commands, aren''t they?
Yes, at first time use.
quote:
But how can I calculate them before use?
You can''t. OpenGL''s vertex array transform system operates using an on-demand, lazy-evaluation concept. A vertex gets only transformed, if an indexed primitive actually uses it (ie. by pointing an index onto it). Then, once computed, it will get stored in an internal vertex cache. As soon as a further primitive (from within the same vertex array) reindexes the same vertex, it will not be recomputed but directly taken from the cache. The cache has a limited size, though, the exact amount depends on your particular hardware.
not as far as I know.
the only thing I definitly know is that the cache size for most directx 7 class hardware (GF 1,2,4mx, not sure about ati here) is that the cache is 16 vertices long, but due to the way it is utilized, it''s effectivly only 10.
This means that drawing terrain in strips of 10 vertices, then moving across a row, can see a massive boost in T&L performance (I saw a good 45% fps boost when I did this a long time ago)
| - Project-X - my mega project.. yup, still cracking along
- | - adDeath - an ad blocker I made - | - email me - |
the only thing I definitly know is that the cache size for most directx 7 class hardware (GF 1,2,4mx, not sure about ati here) is that the cache is 16 vertices long, but due to the way it is utilized, it''s effectivly only 10.
This means that drawing terrain in strips of 10 vertices, then moving across a row, can see a massive boost in T&L performance (I saw a good 45% fps boost when I did this a long time ago)
| - Project-X - my mega project.. yup, still cracking along

RipTorn : Are you using triangle strips & degenerated triangles or plain triangle lists? You can have simmilar speed-ups when using zig-zag pattern (one row to right, the next to left...)
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
triangle strips with degenerate triangles in between...
the way was simply instead of using the ''common'' method of drawing the terrain as a number of rows of triangle strips, I simply drew them:
ignoring the gap in between though...
that way when it gets to 11, that vertex is still in the cache of 10 (number 2).. as will be 13.. etc.
it''s the same for the next row...
the end result is that vertex transforms nearly half, hence the 45% fps improvment I got...
| - Project-X - my mega project.. yup, still cracking along
- | - adDeath - an ad blocker I made - | - email me - |
the way was simply instead of using the ''common'' method of drawing the terrain as a number of rows of triangle strips, I simply drew them:
9--10 \ \ \ \ 7--8 \\ \ \ \5--6 \ 15-- etc\ \ \ \ \ \ 3--4 \ 13-14\ \ \ \ \ \1--2 \11-12
ignoring the gap in between though...
that way when it gets to 11, that vertex is still in the cache of 10 (number 2).. as will be 13.. etc.
it''s the same for the next row...
the end result is that vertex transforms nearly half, hence the 45% fps improvment I got...
| - Project-X - my mega project.. yup, still cracking along

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement