Re: [osg-users] Complete darkness

2008-02-29 Thread Wojciech Lewandowski
Sounds like default Light Model ambient Look at OpenGL docs for 
glLightModel  GL_LIGHT_MODEL_AMBIENT.

Cheers,
Wojtek

- Original Message - 
From: Necdet Can Atesman [EMAIL PROTECTED]
To: osg-users@lists.openscenegraph.org
Sent: Friday, February 29, 2008 1:10 AM
Subject: [osg-users] Complete darkness


 Hi folks,
 
 I am unable to create complete darkness in osg. I'm setting the only
 light source to not emit anything, but the objects in my scene are still
 visible, although very faintly. Is there something wrong with the code,
 or is it just osg/opengl?
 
 osg::Light* light = new osg::Light();
 light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 osgView* view = new osg::View();
 osgView-setLightingMode(osg::View::HEADLIGHT);
 view-setLight(light);
 
 Thanks,
 Necdet Can
 ___
 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


Re: [osg-users] Complete darkness

2008-02-29 Thread Sebastian Messerschmidt
osg::LightModel::setAmbientIntensity(const osg::Vec4 ambient)

IIRC this controls the global ambient intensity. So setting this to zero
might solve your problem.

hth,

Sebastian

Necdet Can Atesman schrieb:
 Hi folks,

 I am unable to create complete darkness in osg. I'm setting the only
 light source to not emit anything, but the objects in my scene are still
 visible, although very faintly. Is there something wrong with the code,
 or is it just osg/opengl?

 osg::Light* light = new osg::Light();
 light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 osgView* view = new osg::View();
 osgView-setLightingMode(osg::View::HEADLIGHT);
 view-setLight(light);

 Thanks,
 Necdet Can
 ___
 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


Re: [osg-users] Complete darkness

2008-02-29 Thread Vincent Bourdier
Maybe just a setnumlight(0)... to replace default light by yours.

Vincent

2008/2/29, Wojciech Lewandowski [EMAIL PROTECTED]:

 Sounds like default Light Model ambient Look at OpenGL docs for
 glLightModel  GL_LIGHT_MODEL_AMBIENT.

 Cheers,
 Wojtek

 - Original Message -
 From: Necdet Can Atesman [EMAIL PROTECTED]
 To: osg-users@lists.openscenegraph.org
 Sent: Friday, February 29, 2008 1:10 AM
 Subject: [osg-users] Complete darkness


  Hi folks,
 
  I am unable to create complete darkness in osg. I'm setting the only
  light source to not emit anything, but the objects in my scene are still
  visible, although very faintly. Is there something wrong with the code,
  or is it just osg/opengl?
 
  osg::Light* light = new osg::Light();
  light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  osgView* view = new osg::View();
  osgView-setLightingMode(osg::View::HEADLIGHT);
  view-setLight(light);
 
  Thanks,
  Necdet Can
  ___
  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

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


Re: [osg-users] Complete darkness

2008-02-29 Thread David Callu
2008/2/29, David Callu [EMAIL PROTECTED]:

 Hi Necdet Can

 Have you try to use an osg::LightModel with ambient == black in your scene
 ?

 In OpenGL, lighting is controlled by glLight and glLightModel.


 HTH
 David Callu

 2008/2/29, Necdet Can Atesman [EMAIL PROTECTED]:
 
  Hi folks,
 
  I am unable to create complete darkness in osg. I'm setting the only
  light source to not emit anything, but the objects in my scene are still
  visible, although very faintly. Is there something wrong with the code,
  or is it just osg/opengl?
 
  osg::Light* light = new osg::Light();
  light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
  osgView* view = new osg::View();
  osgView-setLightingMode(osg::View::HEADLIGHT);
  view-setLight(light);
 
  Thanks,
  Necdet Can
  ___
  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


Re: [osg-users] Complete darkness

2008-02-29 Thread Necdet Can Atesman
Thanks everyone, setting the LightModel solved the problem.
- Necdet Can

Sebastian Messerschmidt wrote:
 osg::LightModel::setAmbientIntensity(const osg::Vec4 ambient)
 
 IIRC this controls the global ambient intensity. So setting this to zero
 might solve your problem.
 
 hth,
 
 Sebastian
 
 Necdet Can Atesman schrieb:
 Hi folks,

 I am unable to create complete darkness in osg. I'm setting the only
 light source to not emit anything, but the objects in my scene are still
 visible, although very faintly. Is there something wrong with the code,
 or is it just osg/opengl?

 osg::Light* light = new osg::Light();
 light-setAmbient(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setDiffuse(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 light-setSpecular(osg::Vec4d(0.0f, 0.0f, 0.0f, 1.0f));
 osgView* view = new osg::View();
 osgView-setLightingMode(osg::View::HEADLIGHT);
 view-setLight(light);

 Thanks,
 Necdet Can
 ___
 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
 
 

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