Hello Keyan, On 09/08/2011 08:37 AM, Keyan wrote: > i am using the following code to produce shadows with a directional light: > > const OSG::UInt32 SM_RESOLUTION = 1024; > > _n_shadowEngine = OSG::SimpleShadowMapEngine::create(); > _n_shadowEngine->setWidth (SM_RESOLUTION); > _n_shadowEngine->setHeight(SM_RESOLUTION); > _n_shadowEngine->setShadowColor(OSG::Color4f(0.1f, 0.1f, 0.1f, 0.0f)); > > DirectionalLightRefPtr lightSource = OSG::DirectionalLight::create(); > lightSource->setAmbient(0.3f,0.3f,0.3f,1); > lightSource->setDiffuse(0.8f,0.8f,0.8f,1); > lightSource->setSpecular(0.0f,0.0f,0.0f,1); > lightSource->setDirection(Vec3f(1,0,-1)); > lightSource->setLightEngine(_n_shadowEngine); > > _n_lightSource = OSG::Node::create(); > _n_lightSource->setCore(lightSource); > > and the result is seen here: > > http://www.picpaste.com/screenshot-X67WxXO0.png
how big is the ground plane? For a directional light the projection for rendering the shadow map is chosen so that it contains the bounding sphere of the scene. If the ground plane is huge your geometry in the foreground may only cover a few pixels in the shadow map, at least that would be my guess what happens looking at the image. Cheers, Carsten ------------------------------------------------------------------------------ Doing More with Less: The Next Generation Virtual Desktop What are the key obstacles that have prevented many mid-market businesses from deploying virtual desktops? How do next-generation virtual desktops provide companies an easier-to-deploy, easier-to-manage and more affordable virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users