Re: [osg-users] ping pong fbo geometry problem

2010-06-05 Thread Julien Valentin
It still not working (I debug fbos powered by glslDevil) 

As my RTT loop implements a minimization of a selected channel I also test an 
assumption that ping pong textures would not be required for my use.
I have then wrote an implementation that read/write the same texture.
only one camera attached to a fbo binded on outtexture
and childs are myGeometry2 that perform occlusion queries whose stateset use 
the same outputtexture as input Texture sampler... 


But curiously I have a strange issue: 
It work if I use 1 only occQuery but not with several...
-Debugging fbos with glsldevil shows me a correct execution of the process but 
when i launch it outside the display seems to get stuck 
unless i cout some stuff during display and switch alt-TAB between commandline 
and osgviewer windows:
It's seems that curiously queries results are made up to date only with this 
hack...

Anyone have experienced this kind of  problem?

[quote=mp3butcher]For the moment I do a silly thing in order to create FBOs 
attached to the current contextID:


I init it at the first drawImplementation call like it:
All vars are pointers in order to be modified inside drawimplementation

Code:
myGeometry::initFBOs{

*_ext=osg::FBOExtensions::instance(contextID,true);
*fbos=new GLuint[2];

  (*_ext)-glGenRenderbuffersEXT(2, *fbos);
  (*_ext)-glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, (*fbos)[0]);
//Dont know if its needed for my use
//(*  _ext)-glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, 
256, 256);
//(*  _ext)-glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, 
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, (*fbos)[0]);

  (*_ext)-glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT, 
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE, 
_OutTexture2-getTextureObject(contextID)-_id, 0);
  (*_ext)-glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);



  (*_ext)-glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, (*fbos)[1]);
  //(*_ext)-glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, 
256, 256);
  //(*_ext)-glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, 
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT,(*fbos)[ 1]);
  (*_ext)-glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT, 
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE, 
_fimpass-_OutTexture-getTextureObject(contextID)-_id, 0);
  (*_ext)-glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);

}




Am I wrong?


Frederic Bouvier wrote:
 Hi Julien,
 
 aren't you supposed to attach a texture to the framebuffer ? I don't see a 
 call to glFramebufferTexture2D or something equivalent in your code.
 In OSG term, it's the Camera::attach method that should be called.
 
 -Fred
 :-*

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28609#28609





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


[osg-users] [osgViewer issue?]

2010-06-05 Thread Julien Valentin
Hi,
I would like to create a pre-display texture that is base on an iterative pre 
rendering process

prerender:
while(texture not ready)
draw a pixel shaded textured quad
}


render:
draw the textured quad  

For this i use FBO RTT Camera and an overrided myGeometry : public 
osg::Geometry that perform occlusion queries on normal osg::Geometrys;

Code:

class myGeometry: public osg::Geometry{
//component geoms
osg::Geometry _component[NBComponents];
drawimplementation(){
while not okay{
   //perform an occlusion query for each component geoms
// update convergence flag based on OccQResults
  okay=update(okay,occlusionsqueriesresults)
 }
}

}
}


I've chosen to override osg::Geometry in order component shares statesate

It work well for one compoenent but i have a steange issue both under linux and 
windows:
-Debugging fbo with glsldevil shows me a correct execution of the process but 
when i launch it outside the display seems to get stuck
unless i cout some stuff during display and switch alt-TAB between commandline 
and osgviewer windows:
It's seems that curiously queries results are made up to date only with this 
hack... 
I havent test it in pure gl/glut so :
Could it be a problem in osgviewer


Thank you!

Cheers,
Julien

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28610#28610





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


Re: [osg-users] performance issue

2010-06-05 Thread Julien Valentin
Tell more about dynamics of your vertices
Static data:
I think you would need to make small geometries and a fitted group hierarchy 
(giving your own bounding boxes) with a visitor ( perhaps just use 
osgutil::optimizer would make a good work)
Dynamic data:
you should your own culling policy use vbos (discharging cpu)and and geometry 
shader culling (discharging GPU)...
 

My master word: batched memory policies.


Gianluca Natale wrote:
 Hi there! 
 
 I have some performance issue when trying to draw objects
 whose geometry contains millions of vertices.
 I want to try everything to improve it (LOD, exclude back faces for closed 
 surfaces,
 use strips and fans, vertex buffer objects, etc…),
 but I wonder if OSG already uses occlusion queries (provided by OpenGL)
 during rendering traversal, applied to the bounding boxes of the 
 geodes/drawables,
 to quickly exclude the complete drawing of that part. 
 Or at least, if there is a way to enable it. 
 I’m using OSG 2.8.0. 
 For my models that would help me a lot, since each geometry has millions
 of vertices, but occlusion queries for bounding boxes would involve only 8 
 vertices at a time. 
 
 Thanks in advance,
 Gianluca
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28612#28612





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


Re: [osg-users] OpenSceneGraph-Data-0.9.6-2

2010-06-05 Thread Julien Valentin
Thinking of a mess in DLL export Macro
Try static link or debug yours __declspec(dllimport)/__declspec(dllexport) 


nerazzuri_4 wrote:
 Hi,
 I am working on building a plugin for a an application that uses osg 0.9.6-2. 
 I am having a hard time finding the release version or the source of it.
 
 I tried using 28.0 but get these weird linker errors even after adding the 
 libs to my linker in visual studio.
 
 For example, here is a linker error I am getting:
 
 1VITASCOPEAddOn.obj : error LNK2001: unresolved external symbol 
 __declspec(dllimport) public: class osg::Vec3f const  __thiscall 
 dcvObject::GetCurPosn(void) 
 (__imp_?getcurp...@dcvobject@@qaeabvve...@osg@@XZ)
 1..\..\..\Apps\VITASCOPE\PROGRAM\PROGRAM\VITASCOPEAddOn.dll : fatal error 
 LNK1120: 1 unresolved externals
 
 The function in question causing this error is:
 
 inline void   SetCurPosn(osg::Vec3 vNewPosn)
 {
   m_vCurPosition.set(vNewPosn.x(), vNewPosn.y(), vNewPosn.z());
   m_pObjRootTransform-setMatrix(osg::Matrix::translate(vNewPosn));
 }
 
 and 
 
 inline const osg::Vec3   GetCurPosn()
 {
   return m_vCurPosition;
 }
 
 I'm kind of stuck as I feel linking the newer libs is causing this.
 
 Any help would be great.
 
 Thanks
 
 Sanat


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28613#28613





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