Hi Carsten, thanks for the quick answer. yes, my ground plate is huge, and i am planing to make it even bigger, as the movement of the six-legged-walking machine should not be restricted. what is the best way to have the same light conditions anywhere on a huge plane, and to have shadows too? the shadows do not have to be coming from a directional light. i also tried a point light with a very far distance, but at some height, there was simply no shadow anymore. if it was to close, there was only a small square illuminated.
cheers, keyan On 8 Sep 2011, at 16:13, Carsten Neumann wrote: > 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 ------------------------------------------------------------------------------ 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