Hi,

<apologies for a relatively long post>


I have an old OpenGL application which uses a so-called "item buffer for lines".
This buffer is based on the idea to associate, upon loading, unique IDs to all 
the lines in the 3D model, then (on each frame) to:

- render all these lines (each with a different color) into this "item buffer", 
  with z-test on and lighting off (in order to preserve lines' colors),

- scan the item buffer in order to detect the lines visible in the current 
frame.
  (Since the line colors are unique, a line is visible if it has at least
  one pixel in this item buffer.) Finally, I 

- render these lines (visible in the current frame) into 
  the color framebuffer.


Now, since my 3D models are getting big, I decided to use OpenSceneGraph 2.4
in order to optimize the processing using occlusion culling, state
sorting and other nice features of scene graphs.


However, where to start? OSG Quick
Guide did not help, so any tips would be welcome. My first idea is to:

- write my own plugin which reads an .osg 3D model and extracts the lines
  of the model into a separate data structure, because it seems that .osg 
  file format does not enforce serialization of lines

- associate unique IDs (which are in 1-1 mapping with unique colors)
  to the extracted lines 

- pre-render the model (z-buffer on, lighting off, with polygons in black) 
  into a  osg::Camera::FRAME_BUFFER_OBJECT

- scan each pixel of the osg::Camera::FRAME_BUFFER_OBJECT to extract currently 
visible
  lines, and place them into a separate vector<>

- render this vector<> (this means that I won't use the scene graph at
  all for final rendering)


Any tips?

Thanks, Lars


      

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to