stride with vertex arrays

Started by
11 comments, last by FReY 18 years, 7 months ago
Quote:Original post by Brother Bob
You call glTranslate before rendering, so unless you reset the matrix somewhere else between the frames, translations will accumulate and increase the rendering distance by 5 for each frame, eventually reaching the far clip plane.


Okay, looks like someone (me) is not paying 100% attention to what he is coding!

Thanks guys.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Advertisement
Quote:Oh la la. Shame on you. The correct stride is 6 floats, not 3. I don't know for nts, but since i know you're an experienced GL programmer

youre correct, and to make matter worse i was doing tests on exactly this yesterday :) (mucking around with adding VBO to my engine).
in my defence i was using sizeof(..)
Just a note on performance of stride:

It will be more efficient to put your vertices with data interleaved at strides of 32 bytes or 64 bytes. And this is because on contemporary hardware, the vertex cache-line size is 32 bytes.

There was some talk about this by Richard Huddy from ATI in the presentations at GDC 2005. Definitely worth a look when they discuss little tidbits like this.

edit: this advice also extends to Nvidia hardware by the way. (One of the presentations by Richard Huddy was a joint ATI/Nvidia effort).

[Edited by - FReY on September 5, 2005 7:05:35 AM]
do unto others... and then run like hell.

This topic is closed to new replies.

Advertisement