the best I can think of is to scan unordered buffer of sprites, finding ouy their indexes order upon many sort alogrithms available , and than build an index buffer to render the unordered buffer by. This way you can have the buffer static, keeping its footprint in CPU, as in many sprite/particles implementations the count of particle elements do not vary. If in your very case a once ordered buffer does not change unless being added a sprite, what seems unlikely, this given approach is valid as well. One drawback of this approach is that the generated indicies will not be adjency friendly. If you want to have unindexed buffer instead, use this approach and by ordered indexes recreate the buffer instead to be ordered upon those indexes. Once added a sprite, you will have to move sprites behind it and expand the buffer, but you would not have to do it if you index the buffer, but it will be just adjency unfriendly.
JohnnyCodeMember Since 10 Mar 2008
Offline Last Active Mar 04 2014 04:22 PM