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

fixed fast sphere rendering

parent 9e5f6b98
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ void CPKRenderer::PrepareRendering(GfxView& view, IndexedVertexArray& va, bool i ...@@ -64,6 +64,7 @@ void CPKRenderer::PrepareRendering(GfxView& view, IndexedVertexArray& va, bool i
#if OST_SHADER_SUPPORT_ENABLED #if OST_SHADER_SUPPORT_ENABLED
if(options_->GetSphereMode()==1 || options_->GetSphereMode()==2) { if(options_->GetSphereMode()==1 || options_->GetSphereMode()==2) {
FastSphereRenderer& fsr = is_sel ? sel_fsr_ : fsr_; FastSphereRenderer& fsr = is_sel ? sel_fsr_ : fsr_;
fsr.Clear();
for(AtomEntryMap::const_iterator it=view.atom_map.begin();it!=view.atom_map.end();++it) { for(AtomEntryMap::const_iterator it=view.atom_map.begin();it!=view.atom_map.end();++it) {
fsr.Add(it->second.atom.GetPos(), fsr.Add(it->second.atom.GetPos(),
is_sel? sel_clr : it->second.color, is_sel? sel_clr : it->second.color,
......
...@@ -41,6 +41,11 @@ namespace ost { namespace gfx { namespace impl { ...@@ -41,6 +41,11 @@ namespace ost { namespace gfx { namespace impl {
data_(d) data_(d)
{} {}
void FastSphereRenderer::Clear()
{
data_.clear();
}
void FastSphereRenderer::Add(float pos[3], float col[4], float rad) void FastSphereRenderer::Add(float pos[3], float col[4], float rad)
{ {
static VData data; static VData data;
......
...@@ -44,6 +44,7 @@ namespace ost { namespace gfx { namespace impl { ...@@ -44,6 +44,7 @@ namespace ost { namespace gfx { namespace impl {
FastSphereRenderer(size_t reserve=0); FastSphereRenderer(size_t reserve=0);
FastSphereRenderer(const DataList&); FastSphereRenderer(const DataList&);
void Clear();
void Add(float pos[3], float col[4], float rad); void Add(float pos[3], float col[4], float rad);
void Add(const geom::Vec3& pos, const Color& col, 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