Robert Osfield a écrit :
Hi Frederic,
With your background image I'd recommend placing an the background
image into the scene graph itself, and just set its render bin to a
negative number so its drawn first. The subgraph to render it would
simply be an osg::Camera at the top of the subgraph to set the view
and project matrices to a HUD and then a full screen texture quad.
The osgdistortion and osghud example should help you along this route.
This would avoid you having to play games with the depth buffer.
Ok, thank you Robert, I thought I could avoid this, but this seems to be
the best way at all.
W.r.t shadows on invisible objects, I don't even know what you might
intended by this, in what way are they invisible? How would you
intend a shadow to be drapped over them?
Yes, you're right, I must make clear what I mean. When I say invisible,
I want these objects to influe only the deph buffer, that's to say these
objects are not visible but are "physically" in the scene. They are not
translucent.
I manage to have this with setting a local State Set attached to these
objects with a color mask set to false :
osg::ref_ptr<osg::StateSet> _local_stateset =
floorGeode->getOrCreateStateSet();
osg::ref_ptr<osg::ColorMask> colorMask = new osg::ColorMask;
colorMask->setMask(false, false, false, false);
_local_stateset->setAttributeAndModes(colorMask.get());
In that case I would like to have shadows drapped on my "invisible"
floorGeode.
But as I set the color mask to false, shadow texture doesn't apply
anymore on the floorGeode.
To go back to osgDepthShadow example, is there one way to have the same
shadows drapped over the base floor box but with this base floor box
invisible ?
Hope I was clear enough..
Thanks
Frédéric.
Robert.
On 7/2/07, Frédéric SPEISSER <[EMAIL PROTECTED]> wrote:
Hi all,
Firstly, congratulations for 2.0 !
Secondly, two questions :
1. I'm using the osgViewer::Viewer. I'm rendering a scene with a
background image, so i do a
_viewer->getCamera()->setClearMask(GL_DEPTH_BUFFER_BIT);
before _viewer->frame();
In order to maintain my background image at each frame. Now I want to
add shadows to my scene, so i'm using the shadows map technique (seen in
osgDepthShadow example), but due to
_viewer->getCamera()->setClearMask(GL_DEPTH_BUFFER_BIT); I see also the
rendering of the view of the camera associated with the shadow map, so I
have two view of my scene in the same window, one from the camera, and
another from the light source (the camera ssociated with the shadow
map).
How can I solve my problem ?
That's to say how can I use osgDepthShadow example with a background
image ?
2. I would like to have shadows on invisible objects. Is that possible
since shadow map using a texture ?
Thank you per advance.
Frédéric.
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/