[osg-users] How to render (sub-)graph only into depth buffer?

2016-12-16 Thread Hartwig Wiesmann
Hi,

I would like to fill the depth buffer with the data of a rendered subgraph. The 
subgraph itself should not be visible in the view. Afterwards, I want to render 
another - and now visible - subgraph that uses (and modifies) the previously 
filled depth buffer.

How can I do this?

I wrote a small program for testing but unfortunately this does not fill the 
depth buffer (the box is completely visible):


Code:

osg::Geode*   geode(new osg::Geode());
osg::Program* prog(new osg::Program());
osg::Shader*  vshader(new osg::Shader(osg::Shader::VERTEX,  
gVertexShader));
osg::Shader*  fshader(new 
osg::Shader(osg::Shader::FRAGMENT,gFragmentShader));
osg::ShapeDrawable* box(new osg::ShapeDrawable(new 
osg::Box(osg::Vec3(0,0,0),100.0)));
osg::ShapeDrawable* sphere(new osg::ShapeDrawable(new 
osg::Sphere(osg::Vec3(50.0,50.0,50.0),100.0)));

prog->addShader(vshader);
prog->addShader(fshader);
box->getOrCreateStateSet()->setAttribute(new 
osg::ColorMask(true,true,true,true));
sphere->getOrCreateStateSet()->setAttribute(new 
osg::ColorMask(true,false,false,true));
sphere->getOrCreateStateSet()->setAttribute(new osg::Depth());
geode->addDrawable(box);
geode->addDrawable(sphere);
geode->getOrCreateStateSet()->setAttribute(prog);
_root->addChild(geode);




Thank you!

PS: The vertex shader just calculates the position by multiplying the 
view-projection matrix with the vertex vector and the fragment shader just 
returns a color value.

Cheers,
Hartwig

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69698#69698





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


Re: [osg-users] Open Scene Graph 3.4.0 has bug when using two monitor setup

2016-12-16 Thread Bruce Clay
Hi,

I realize this is an old thread but I am having the same problem with 
OpensSceneGraph displaying on two monitors.  It always crashes in 
Group::traverse called from NodeVisitor::traverse. If I turn off the second 
monitor it does not crash.

I have tested on osgViewer and other apps in the source tree.  If I add the 
--SingleThreaded to the argments as described above it does not crash.  I first 
encountered the problem with osgEarth but it seems to be in the osg threading 
somewhere.  I am runningOSG version 3.4 on windows 7 using Visual Studio 2013

Thank you!

Cheers,
Bruce

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69697#69697





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


[osg-users] how to get pixel value using X and Y coordinates

2016-12-16 Thread Uma Devi Selvaraj
Hi ,

 I have rendered image using osgviewer. I have added pickhandler to get x 
and y coordinates by clicking mouse left button. Is it possible to get pixel 
value corresponding to that X and Y coordinates.Is there any example related to 
that.? 


... 

Thank you!

Cheers,
Uma

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69696#69696





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


Re: [osg-users] Triton Ocean

2016-12-16 Thread webmaster
Hi Rambabu,
Are you belong animals or humans???
zhuwan
12,16,2016

> -原始邮件-
> 发件人: "Rambabu Repaka" 
> 发送时间: 2016-12-15 17:20:18
> 收件人: osg-users@lists.openscenegraph.org
> 抄送: 
> 主题: Re: [osg-users] Triton Ocean
> 
> Hi,Thanks Robert I thought it is not an email id.
> 
> ... 
> 
> Thank you!
> 
> Cheers,
> Rambabu
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69689#69689
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org