want to have both dynamic and ambient light

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lg

want to have both dynamic and ambient light

Post 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
LittleGiant
Posts: 15
Joined: Wed Jun 02, 2004 1:53 am

Post 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?
LittleGiant
Unarekin
Posts: 60
Joined: Thu Apr 22, 2004 11:02 pm

Post by Unarekin »

RTFM!
setAmbientLight (SColorf &color)
LittleGiant
Posts: 15
Joined: Wed Jun 02, 2004 1:53 am

Post 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.
LittleGiant
Unarekin
Posts: 60
Joined: Thu Apr 22, 2004 11:02 pm

Post 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.
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post 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?
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post 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.
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post 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...
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Can't find anything to disable ambient light for one object :(
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
R00mpel
Posts: 41
Joined: Sun Nov 09, 2003 10:12 am
Location: Russia, Nizhny Novgorod

Post 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);
}
The only thing to fear is running out of beer!
Post Reply