[osg-users] OSG rendering inside OpenGL application

Javier Taibo jtaibo at udc.es
Sat Oct 13 03:13:30 PDT 2007


  Hi,

  I am trying to use OSG for rendering a scenegraph to texture for its
use in an OpenGL application.

  The application binds an FBO with a texture attached to it and
establishes the Viewport where the render should be done, so I have a
valid and active OpenGL context configured to just draw the primitives.
Then, a virtual method of an abstract class is called to do the render.
I want to make an implementation of this class based on OSG to render
complex scenes and load them from any file format supported by OSG.

  What is the best way to do it? I am wondering about using a SceneView
object or doing it at a lower level (building the CullVisitor,
RenderStage, StateGraph, etc). 

  As the second choice considerably more difficult, I'm trying first
using SceneView. I am initializing with

    _sceneView = new osgUtil::SceneView();
    _sceneView->setDefaults();
    _sceneView->setSceneData( _escena.get() );

  and then every frame, after placing the camera I do the traversals

    _sceneView->update();
    _sceneView->cull();
    _sceneView->draw();

  but I am getting this message continuously:

  Warning: detected OpenGL error 'invalid operation' after
RenderBin::draw(,)


  I would like to know the experts suggestions, just in case I am doing
it the wrong way.

  Is there any example/tutorial/source code doing something similar that
I can take a look at?

  Thanks in advance.


-- 
Javier Taibo
VideaLAB. Grupo de Visualización en Ingeniería, Arquitectura y Urbanismo
E.T.S.I. de Caminos, Canales y Puertos
Universidade da Coruña
Campus de Elviña, s/n
15071 - A Coruña (Spain)
+34-981-167000 (ext. 5444)
http://videalab.udc.es





More information about the osg-users mailing list