On Jul 30, 2010, at 5:45 PM, Carsten Neumann wrote:
> Hello Patrick,
>
> Patrick Hartling wrote:
>> On Jul 30, 2010, at 1:40 PM, Carsten Neumann wrote:
>>> Patrick Hartling wrote:
>>>> When using OSG::GrabForeground with OpenSG 2, I find that some parts of
>>>> the scene graph are not being grabbed. Is there anything besides the
>>>> traversal mask on the viewport that influences grabbing? The viewport has
>>>> a traversal mask of 0x1, and as far as I can tell, the nodes that are not
>>>> being captured have a mask of 0xffffffff. Of the 4151 nodes in the scene
>>>> graph I just tested, only 4 do not have a mask of 0xfffffff, and those
>>>> four being included with the image output just as I expect.
>>> the GrabForeground simple does a glReadPixels to copy the application frame
>>> buffer into it's image. It should not have any influence on what is being
>>> rendered, especially since all Foregrounds have their draw() method called
>>> after the scene rendering is already done.
>> That's what I thought from looking at the OSG::Viewport and
>> OSG::GrabForeground code, but I thought maybe I was missing some subtle
>> detail.
>
> I don't think so or at least I'm missing it too then ;)
>
>>>> In case it makes any difference, the nodes that are being missed are
>>>> loaded from OSB files. We are using a custom render action, but it is a
>>>> simple subclass of OSG::RenderAction that adds two data members needed as
>>>> a conveniences for other parts of our software. The only method that we
>>>> override is OSG::RenderAction::start(), and that is just so that we can
>>>> set a value for one of the two added data members. The override calls up
>>>> to OSG::RenderAction::start() just as it ought to.
>>> Do the missed nodes show up when rendering without the GrabForeground?
>> Yes.
>
> This is the part were it gets seriously strange, to me it simply makes no
> sense that doing a glReadPixels causes some objects to disappear.
>
>>> What happens if you load the OSB files with e.g. testSimpleSceneManager?
>> I tried loading some at random using testSimpleSceneManager, and it had no
>> difficulty with any.
>
> ok.
>
>>> Have you tried to run the VerifyGeoGraphOp on the problematic nodes (not
>>> that it can catch all errors with geometry, but it does find a few obvious
>>> ones)?
>> OSG::VerifyGeoGraphOp does not report problems for any of the 1600+ models
>> that I have.
>
> ok, thanks for checking.
>
>>> From what you describe I don't see how the custom RenderAction could be a
>>> problem or the GrabForeground for that matter. Can you give some more
>>> details on your setup, please. I believe something else must be involved to
>>> prevent the nodes from rendering.
>> Our custom scene manager has a viewport with an grab foreground associated
>> with it at all times. The viewport is associated with a passive window that
>> is itself driven by a Qt 4 QGLWidget. The grab foreground is deactivated
>> except when we want to capture what OpenSG will render. When we do that, we
>> activate the grab foreground, force the window to render using the same
>> render action object used for "normal" rendering, and then disable the grab
>> foreground again. This all works like a charm except for these models.
>
> hm, can you run your application through a GL debugger to get OpenGL call
> logs for the cases with and without active GrabForeground?
> Perhaps diff'ing them reveals something useful to go by.
> One other question, are you changing the value of Window::sfDrawMode_, i.e.
> are you using the parallel drawer or the default sequential drawer?
>
> I've attached a modified testSimpleSceneManager that adds a GrabForeground,
> can you try that with one of the problematic models? I don't really expect it
> to replicate the problem, but just maybe we get lucky ;) If a single model
> does not work, maybe writing all or part of your scene as OSB and loading
> that with the modified testSimpleSceneManager does the trick?
Thanks for the code to test, but for some reason, it is crashing in the
glReadPixels() call. I haven't had any success figuring out why. It crashes
with the models I am trying to capture and with beethoven.wrl from the OpenSG
example data. For reference, i am testing on Windows 7 at the moment.
-Patrick
--
Patrick L. Hartling
Senior Software Engineer, Priority 5
http://www.priority5.com/
The information transmitted in this communication is intended only for
the person or entity to which it is addressed and contains proprietary
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please destroy any copies, contact the sender
and delete the material from any computer.
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users