Hello Vincenzo,
Vincenzo Marafioti wrote:
>> This is a snippet of the code:
>>
>> GLuint _queryFBO[1];
>> SLOG <<"Number of MFForegrouds: " <<
>> getMFForegrounds()->size() << std::endl;
>> glGenQueriesARB(1, _queryFBO);
>> glErr("Manual glGenQueriesARB");
>> glBeginQueryARB(GL_SAMPLES_PASSED_ARB, *_queryFBO);
>> glErr("Manual glBeginQueryARB");
>> for (UInt16 fi=0; fi <
>> getMFForegrounds()->size(); fi++)
>> { getForegrounds(fi)->draw(action,
>> this); }
>> glEndQueryARB(GL_SAMPLES_PASSED_ARB);
>> glErr("Manual glEndQueryARB");
>> int pixelFBO = -1;
>> glGetQueryObjectivARB(*_queryFBO, GL_QUERY_RESULT_ARB, &pixelFBO);
>> glErr("Manual glGetQueryObjectivARB");
>> SLOG <<"FBO - fragment passed: " << pixelFBO << std::endl;
>> glDeleteQueriesARB(1, _queryFBO);
>> glErr("Manual glDeleteQueriesARB");
>> < file: OSGFBOViewport.cpp - line: 1435 >
>>
>> I modified the 29FBOViewport.cpp file in order to simulate the
>> situation that interest me (OGL Occlusion query into a FBO where i
>> have attached an PolyForeground) (see the attachment). I tried also to
>> Push/Pop Attrib before OQ stuff.
>> The output is show into the attached image. The OQ made in
>> 29FBOviewport.cpp returns me some result but i can't say it is the
>> right one. The OQ made into OpenSG code gives me some error and no
>> result. My glErr seems gives no error.
>>
>> Do you have any idea about? Nobody had to face the same situation before?
>> Thank you.
> With some help I was able to solve it!
great, I'm happy to hear that!
I'd still be interested to know why it is necessary to move the queries
into the FBOViewport, since that is not a really nice solution.
> The OQ stuff written in the
> OpenSG FBOViewport works if I disable OcclusionCulling test. The problem
> seems to be related to the generation of a new Occlusion Query between a
> glBeginQuery and glEndQuery.
hm, yes, you can basically only have one query for each query target
(e.g. GL_SAMPLES_PASSED) at any given time. Since the occlusion culling
also needs to run a query to discover if the bounding box of a node is
visible it interferes with your queries.
Cheers,
Carsten
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users