Hello Johannes, On 08/22/2013 10:12 AM, Johannes Brunen wrote: > I have tried to make use of the occlusion culling support of OpenSG. For > that I have changed my code as described by > > http://www.opensg.org/wiki/DevGuide/OcclusionCulling#OcclusionCulling > i.e. added the following lines to my render call: [SNIP] > After loading an existing model I got the following crash: > > > > OSGSystemD.dll!OSG::DrawableStatsAttachmentBase::getValid() Line 241 + > 0x11 bytes C++ > > OSGSystemD.dll!OSG::DrawableStatsAttachment::validate() Line 193 + 0xd > bytes C++ > > OSGSystemD.dll!OSG::OcclusionCullingTreeBuilder::testNode(OSG::OCRenderT > reeNode * pNode=0x00000000145ae8c0, OSG::DrawEnv & denv={...}, > OSG::RenderPartitionBase * part=0x000000000da12000, float & > scr_percent=0.010344837) Line 518 C++ [SNIP]
That is strange, anything that makes it into the OcclusionCullingTreeBuilder has a DrawableStatsAttachment, RenderPartition::dropFunctor() (OSGRenderPartition.cpp:346) makes sure of it. Can you set a breakpoint there and see if/why it does not create the missing attachment? > The DrawableStatsAttachment *st = > DrawableStatsAttachment::get(pNode->getNode()->getCore()); > > is NULL which causes the crash. right, there is no test for NULL there, because these attachments should have been added on anything that does not have one - question is why was it being omitted here? > Do I have to take any other measures beside of the above changes to my > code? I don't think so, if that's what the example does it should suffice. > Is the occlusion culling still in use and supported? *cough* uhm, well, given the size of the user base these days... > Is it advisable to use occlusion culling in modern GPU/shader etc. > setups? I'd say it depends more on the scene. For scenes with many medium-high complexity objects and high overdraw it should be a win. If your objects are few, the early-z test may be enough (possibly with a depth only pass done first). The other important factor is if the occlusion queries (or rather reading back their results) causes pipeline stalls - OpenSG can not use the results from previous frames, so that may cause stalls. > Any idea what goes wrong and causes the crash? Not really, see above. > In my setup I use > GL_TRIANGLES_ADJACENCY_EXT and GL_TRIANGLE_STRIP_ADJACENCY_EXT > GL primitives for my meshes. Can this be problematic for the occlusion > culling implementation? Hmm, it may get the wrong idea about the size of the geometry (unless DrawableStatsAttachment can account these primitive types correctly), but the occlusion culling just draws the bounding box and if fragments pass the occlusion test it draws the geometry, so does not care that much about the primitive type. Cheers, Carsten ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users