Skip to content
Snippets Groups Projects
Commit 3a862e10 authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

fixed fast sphere rendering

parent 9e5f6b98
Branches
Tags
No related merge requests found
......@@ -64,6 +64,7 @@ void CPKRenderer::PrepareRendering(GfxView& view, IndexedVertexArray& va, bool i
#if OST_SHADER_SUPPORT_ENABLED
if(options_->GetSphereMode()==1 || options_->GetSphereMode()==2) {
FastSphereRenderer& fsr = is_sel ? sel_fsr_ : fsr_;
fsr.Clear();
for(AtomEntryMap::const_iterator it=view.atom_map.begin();it!=view.atom_map.end();++it) {
fsr.Add(it->second.atom.GetPos(),
is_sel? sel_clr : it->second.color,
......
......@@ -41,6 +41,11 @@ namespace ost { namespace gfx { namespace impl {
data_(d)
{}
void FastSphereRenderer::Clear()
{
data_.clear();
}
void FastSphereRenderer::Add(float pos[3], float col[4], float rad)
{
static VData data;
......
......@@ -44,6 +44,7 @@ namespace ost { namespace gfx { namespace impl {
FastSphereRenderer(size_t reserve=0);
FastSphereRenderer(const DataList&);
void Clear();
void Add(float pos[3], float col[4], float rad);
void Add(const geom::Vec3& pos, const Color& col, float rad);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment