Material with normal maps ignores ambient light

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Auria
Competition winner
Posts: 120
Joined: Wed Feb 18, 2009 1:11 am
Contact:

Material with normal maps ignores ambient light

Post by Auria »

Hi,

see the attached screenshot :

Image


I am making a material with normal maps (EMT_NORMAL_MAP_SOLID). Unfortunately for some reason I can't figure out, the faces that face away from the directional light are pitch-black - even though the scene has an ambient light (scene_manager->setAmbientLight) and even though I too gave an ambient color to the material in question.

This is irrlicht SVN (trunk r3842) on OS X 10.6

Anyone has any clue what's going on there?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Material with normal maps ignores ambient light

Post by hybrid »

I don't think that ambient light is implemented in the normal map shader. You have to use your own shader.
Auria
Competition winner
Posts: 120
Joined: Wed Feb 18, 2009 1:11 am
Contact:

Re: Material with normal maps ignores ambient light

Post by Auria »

hybrid wrote:I don't think that ambient light is implemented in the normal map shader. You have to use your own shader.
I see :( do you know of any way to get rid of this "dark side of the moon" effect on materials that have normal maps, without resorting to placing pointlights everywhere?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Material with normal maps ignores ambient light

Post by hybrid »

Nothing besides adding your own shader. You might also use a two pass rendering where you first render a solid ambient pass, and then a transparent normal mapped pass. But I doubt that this will help in any situation, besides that you save the additional material creation in your app.
Post Reply