Hi Chris,
I'm afraid the code was written as part of a research project, and we
still haven't decided upon whether or not the code is going into the
public domain or not so I can't really give out my classes. However, I
have included a function that may help you. You'll have to fill in the
rest I'm afraid. The white paper they supply is very good.
If you've ever used multiple camera objects in an OSG program you
shouldn't find it a problem. The trickiest part in my opinion was
creating the class to generate the little header in the top left corner
of the image, but that was only because it was fiddly bit shifting.
I've only worked with the standard 50/50 stereo image, I believe
Phillips support a couple of different formats, one of which splits the
screen into 4 that allows you to compensate for the strange blurring
effect you get on the edge of objects.
As for the blurring in the distance, I get that too, but haven't
attempted to fix it, I would imagine dynamically modifying the depth map
calculation would go some way to solve this and it's easily done if you
use the shader approach that I took.
As Robert says there's no need to use any APIs etc, OSG provides all the
tools to generate and modify the stereo format in the scene graph.
Fire back if you need any further hints or tips.
Kim.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Denham
Sent: 03 April 2008 09:59
To: [email protected]
Subject: Re: [osg-users] Philips WOWvx technology and OpenSceneGraph
Hi Kim,
I was wondering if you were able to share your code that does this?
What occurred to me was that it would be pretty cool to see this
functionality as an extra 'stereo' option for OSG.
You make it sound easy... but in my experience, "straight forward"
means different things to different people! ;-)
Cheers
Chris.
> Date: Wed, 2 Apr 2008 15:58:26 +0100
> From: "Kim C Bale" <[EMAIL PROTECTED]>
> Subject: Re: [osg-users] Philips WOWvx technology and OpenSceneGraph
> To: "OpenSceneGraph Users" <[email protected]>
>
> It's a fairly straight forward process, you have to send the display a
> custom image format. You split the screen in half horizontally, render
> your scene normally in the left half and then render a custom depth
map
> format on the right, I did the depth version using a simple shader,
but
> I'm sure there are other ways.
>
> You then have to encode a 32bit (i think?) pattern into the blue
pixels
> in the first row of framebuffer so that it picks up the WOW format.
You
> can do that by simply writing the pixels direct to the screen using
> osg::DrawPixels and a post render camera.
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
osg::ref_ptr<osg::Node> WOWDisplay::addWOWToSubGraph( osg::Node* p_node )
{
GLShader shader;
shader.load("depth_shader", "depth_shader.f", "depth_shader.v");
osg::Group* renderGroup = new osg::Group();
osg::Group* depthGroup = new osg::Group();
osg::Group* normalGroup = new osg::Group();
depthGroup->getOrCreateStateSet()->setAttributeAndModes( shader.get(),
osg::StateAttribute::ON );
depthGroup->getStateSet()->addUniform( new osg::Uniform("near",
(float)1) );
depthGroup->getStateSet()->addUniform( new osg::Uniform("far",
(float)300 ) );
depthGroup->setNodeMask( 0x1 );
normalGroup->setNodeMask( 0x2 );
depthGroup->addChild(p_node);
normalGroup->addChild(p_node);
renderGroup->addChild(depthGroup);
renderGroup->addChild(normalGroup);
osg::Vec4 clear1(0.0f, 0.0f, 1.0f, 1.0f);
osg::Vec4 clear2(0.0f, 0.0f, 0.0f, 1.0f);
// Cull Depth View
osg::ref_ptr<osg::Camera> sceneCam = halfScreenRender( clear1,
0,
0,
m_screenDims.x()/2.f,
m_screenDims.y(),
false);
// Cull normal view
osg::ref_ptr<osg::Camera> depthCam = halfScreenRender( clear2,
m_screenDims.x()/2.f,
0,
m_screenDims.x()/2.f,
m_screenDims.y(),
true);
osg::ref_ptr<osg::Camera> postCam = postRenderCamera( m_screenDims );
osg::Group* grp = new osg::Group();
sceneCam->addChild( renderGroup );
depthCam->addChild( renderGroup );
grp->addChild( sceneCam.get() );
grp->addChild( depthCam.get() );
postCam->addChild( drawHeader( m_screenDims ).get() );
grp->addChild( postCam.get() );
return grp;
}
*****************************************************************************************
To view the terms under which this email is distributed, please go to
http://www.hull.ac.uk/legal/email_disclaimer.html
*****************************************************************************************
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org