Hi Robert,
Do you get that error on exit? The comments on the code around the place it fails under windows suggests there are threading issues to do with deleting the PixelBuffers, and setting single threaded mode on the viewer made the problem go away.

But in any case, I think you are right, (although WOWvx is pretty unusable for my scenes without that change), I agree it needs some more thought to do it in a better way.

I have stuggled in the past with solutions involving near and far planes, but the problem seemed to be that OSG would often use a near plane distance where all the pixels actually rendered to the depth map get a value close to 1.0. I think this effect is shown clearly with my "go inside the box example". I did have an earlier discussion about near-far planes on the user list in relation to this problem, but we didn't come up with anything that helped (well, apart from my understanding of the 'depth' of the problem lol.)

I think your idea for using shaders to calculate the min depth is the right way to go, indeed I did consider that, but I couldn't work out how to do it. Shaders have two types right? One type for vertices and one for pixels, I need the minimum depth value in the pixel shader, but neither type seemed the right place to sample all the depth values to calculate the minimum value.

CCing osg-users for ideas!

Cheers
Chris.


----- Original Message ----- From: "Robert Osfield" <[EMAIL PROTECTED]> To: "Chris Denham" <[EMAIL PROTECTED]>; "OpenSceneGraph Submissions" <[EMAIL PROTECTED]>
Sent: Friday, November 21, 2008 4:57 PM
Subject: Re: [osg-submissions] Patch for Philips WOWvx Displays


Hi Chris,

I can reproduce the problem with going inside the box reliably so
thumbs up on a good test case.

I've merged and test the code and under Kubuntu 7.10 and get the error:

Got an X11ErrorHandling call display=0x70a410 event=0x7fffb8f1bd70
GLXBadPbuffer
Major opcode: 128
Minor opcode: 28
Error code: 138
Request serial: 56
Current serial: 57
 ResourceID: 4294967295
Got an X11ErrorHandling call display=0x70a410 event=0x7fffb8f1c460

Which is not too dissimilar the error you've see under Windows.  This
strongly suggests that the is problem with the visuals that are been
requested for this window.

Having reviewed the wider algorothim that you are using here, I can't
help but feel that doing a read back to main memory and then analysing
depth this data on the CPU is really poor solution performance wise.

Could one not use the computed near/far planes of the RTT camera
handling the rendering of the scene?  Or if you really have to analyse
the depth data then this really should be done using a shader down on
the GPU.

Given that the submission produces known errors on two platforms, and
implements are very inefficient technique I feel that this submission
is not ready to merge - it introduces more problems than is solves.

Perhaps a discussion on osg-users might strike us some different ideas
on how to tackle the issues with the current implementation.

Robert.

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

Reply via email to