>>
>>
>>> Carsten Neumann ha scritto:
>>>
>>>> hm, I don't understand what is happening, if I put the OC query
>>>> around mgr->redraw() it works fine, but for the FBO it always
>>>> returns 0. Whether the FBO is rendered before or after the main
>>>> scene does not make a difference either (I thought perhaps a render
>>>> target change would reset the counters).
>>
>> I've now looked at the OpenGL commands that are issued with bugle and
>> there is nothing that looks suspicious to me, so I'm still confused
>> why it's not simply working.
>> One thing you might want to try is hacking the FBOViewport so that
>> the begin/end query commands are issued while the FBO is active, that
>> is about the only thing I can think of that might cause the samples
>> for the FBO to be zero all the time, although I can not find anything
>> about it in the spec.
>>
>>
> First of all excuse me if I insist obout this argument but it is very
> strange OpenSG behaviour.
> I made some "hacking" to the FBOViewport Class and recompiled OpenSG.
> 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! 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.
Now i need to make it reliable in a safe way!
------------------------------------------------------------------------------
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