[C++] Linear-Speed Vertex Cache Optimisation
От: rusted Беларусь  
Дата: 25.08.08 16:24
Оценка: 8 (3)
Реализация алгоритма из этой статьи: http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html

Пример использования:
#include "acmr.h"
#include "ls_vcache_opt.h"

{
    std::vector<unsigned short> pos_indices;
    std::vector<my_vertex> vertices;

    //...

    float acmr_before = ls_vcache_opt::acmr( &pos_indices[0], pos_indices.size()/3, 16 );
    ls_vcache_opt::optimize( &pos_indices[0], pos_indices.size()/3, vertices.size() );
    unsigned short num_verts = ls_vcache_opt::reorder_vertices( &pos_indices[0], pos_indices.size()/3, vertices );
    vertices.resize( num_verts );
    float acmr_after = ls_vcache_opt::acmr( &pos_indices[0], pos_indices.size()/3, 16 );
}


код:
http://files.rsdn.ru/38429/ls_vcache_opt.zip
vertex cache optimisation
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.