vtkOpenGLVertexBufferObjectGroup

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

vtkOpenGLVertexBufferObjectGroup

David Thompson-2
Hi all (but esp. Ken and Alexis),

I'm working on a project to use VTK's mappers to render VTK-m data (already resident on the GPU but not necessarily exposed to OpenGL).

Recently the vtkOpenGLPolyDataMapper was refactored to keep VBOs in the new vtkOpenGLVertexBufferObjectGroup class. This makes using the shaders in the mapper difficult because the buffer-group uploads arrays to the VBOs (which we want to avoid because the arrays are already on the GPU) and creates VBOs (meaning there is no way to create subclass of vtkOpenGLVertexBufferObject that overrides Upload() or something similar).

Do you have any ideas about how we might change the buffer-object-group to allow zero-transfer VTK-m arrays to be handled without uploading them? Perhaps we could add a method to vtkOpenGLVertexBufferObject that visits all the arrays for each VBO it has created?

class vtkOpenGLVertexBufferObject
{
...
  void VisitAllVBOs(
    vtkOpenGLVertexBufferObjectCache* vtkNotUsed(cache),
    std::function<void(
      const std::string&,
      vtkOpenGLVertexBufferObject*,
      vtkDataArray*)> visitor)
  {
    for (arrayIter bi = this->UsedDataArrays.begin();
      bi != this->UsedDataArrays.end(); ++bi)
    {
      for (auto ai : bi->second)
      {
        visitor(bi->first, this->UsedVBOs[bi->first], ai);
      }
    }
  }
...
};

This would get us 90% of the way to VTKm-based mappers (subclasses of vtkOpenGLPolyDataMapper), since we could write a visitor and skip the BuildAllVBOs() call.

        Thanks,
        David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers

Loading...