HI Nickolai,
If you don't want the default global light then simple do:
viewer.setLightingMode(osg::Viewer::NO_LIGHT);
Rather than switching it to SKY_LIGHT!
Robert.
On 5 June 2016 at 22:44, Nickolai Medvedev wrote:
> Well, we can deceive viewer if we make so:
>
If you don't want any light in your scene
You just have to
setMode(GL_LIGHTING,OFF,OVERRIDE) on you root's stateset
Hope it helps
Ben Axelrod wrote:
> I cannot seem to turn off the light in osg::View. I can change it between
> headlight and sky light, but when I try NO_LIGHT, I still get the
Well, we can deceive viewer if we make so:
Code:
viewer.getLight()->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0));
viewer.getLight()->setPosition(osg::Vec4(0.0,0.0,0.0,1.0));
viewer.getLight()->setDiffuse(osg::Vec4(0.0,0.0,0.0,1.0));
viewer.getLight()->setConstantAttenuation(0.003);
Hi Ben,
If there are modes in your scene graph that enable lighting then
you'll get the default OpenGL lighting values. You don't say what
effect you actually want to achieve so can't comment on what you
should do in your scene graph, you'll need to provide more info.
FYI, Viewer is a View, so
I cannot seem to turn off the light in osg::View. I can change it between
headlight and sky light, but when I try NO_LIGHT, I still get the headlight.
_viewer-getCamera()-getView()-setLightingMode(osg::View::SKY_LIGHT); //works
17, 2009 11:36 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osg::View NO_LIGHT bug?
I cannot seem to turn off the light in osg::View. I can change it between
headlight and sky light, but when I try NO_LIGHT, I still get the headlight.
_viewer-getCamera()-getView
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ben
Axelrod
Sent: Tuesday, February 17, 2009 3:09 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osg::View NO_LIGHT bug?
I still don't know why osg::View
Ben,
osg::View's setLightingMode with NO_LIGHT as a parameter doesn't actually
turn any lights off (just look at the source in osg/View.cpp). If the
lightingMode is *not* NO_LIGHT, then it sets light 0 with the default 0.8
diffuse value etc. I presume this is by design, although I'm not sure why!
- From: Ben Axelrod at 2009-02-18 07:09-
I
still dont know why osg::View::NO_LIGHT doesnt work, but to answer my own
questions, to turn off the default light completely:
{
light-setAmbient(osg::Vec4(0,0,0,1));
light-setDiffuse(osg::Vec4(0,0,0,1));
9 matches
Mail list logo