Page 1 of 1

want to have both dynamic and ambient light

Posted: Mon May 31, 2004 6:32 pm
by lg
can someone please help me out i want to have all the textures be 25% lit at all times then have dynamic lights only add to that.

not sure how to accomplish this ...

thx,
Chris

Posted: Fri Jun 04, 2004 6:48 pm
by LittleGiant
So no one knows how to do this? Should i try creating a lightmap of some sort to do this? Seems like a waste to me...

Anyone have any comments on this?

Posted: Fri Jun 04, 2004 7:41 pm
by Unarekin
RTFM!
setAmbientLight (SColorf &color)

Posted: Sat Jun 05, 2004 1:04 am
by LittleGiant
Well i don't think you need to reply in that manor.

But i have tried

Code: Select all

driver->setAmbientLight(video::SColorf(1.0f,1.0f,1.0f,0.01f));
and even with that it seems to be completely lit.
i can change it to say video::SColorf(1.0f,0.0f,0.0f,0.01f) and everything is red, so i'm a bit confused isn't the alpha channel used?

EDIT:
Alright i've gotten it working using:

Code: Select all

driver->setAmbientLight(video::SColorf(0.2f,0.2f,0.2f,0.2f));
I guess my problem came from a misunderstanding of the alpha channel.

Thank you to those who read this post geniuinly trying to actually help.

Have a great day.

Posted: Sat Jun 05, 2004 3:25 am
by Unarekin
Eh, apparently I came off in the wrong tone. I wasn't (trying) to be rude at all. It's just that a quick search for 'Ambient' in the documentation returned that function.

Posted: Sat Jun 05, 2004 10:17 am
by VeneX
With ambient light the lightning of dynamic light doesn't react smooth. Is it possible to disable ambient light for just some models in the game?

Posted: Sat Jun 05, 2004 12:24 pm
by Tyn
I think that every object has an ambiant light value, so you could set it to default for whatever models you want to react normally. The API usually tells you the default value, that would be a good place to start.

Posted: Sat Jun 05, 2004 1:57 pm
by jox
SColor and SColorf use different initializations (concerning alpha):

SColorf(red, green, blue, alpha)

SColor(alpha, red, green, blue)

So it can be confusing...

Posted: Sun Jun 06, 2004 8:51 am
by VeneX
Can't find anything to disable ambient light for one object :(

Posted: Mon Jun 07, 2004 2:38 pm
by R00mpel
You can use something like this to disable ambient lighting for certain SceneNodes:

Code: Select all

IAnimatedMeshSceneNode *newNode;
.
.
.
for(int i = 0; i < newNode->getMaterialCount(); i++)
{
    newNode->getMaterial(i).AmbientColor.set(0, 0, 0, 0);
}