Ambient lighting

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
vincent-v
Posts: 10
Joined: Wed Jan 06, 2010 9:39 pm
Location: Valbonne, France

Ambient lighting

Post by vincent-v »

How I can get a correct shaded node with just ambient light ? I mean like on this screenshot :

Image

In spite of trying many things with material, my cube is fully white.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Ambient light doesn't do what your looking for, it brightens things without respect to the facing. Try adding a light scene node and setting it as a child of the camera. This would cause any faces you can see to be lit up, and be nicely shaded as in the picture.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

directional light is what you're looking for, and as Lonesome Ducky pointed out, setting it as a child of the camera will make it behave nicely (as lights usually do in 3d editing programs) if not entirely naturally. You'll also want to play with the angle it's at relative to the camera to get a nice effect. Sending it directly forwards can feel a little weird.
Also you probably want to keep some ambient light (not much), so that your shadows don't become too dark.
vincent-v
Posts: 10
Joined: Wed Jan 06, 2010 9:39 pm
Location: Valbonne, France

Post by vincent-v »

There is no way to avoid dynamic lights ? Then how to light up an entire scene ?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

To light up the whole scene it might not have to be directional - then you can use ambient light. Another solution is using lightmaps (textures) for the light. For testing out the effect of light on models with and without textures and with and without lights you can also play around with Example 22 MaterialViewer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Keyosz
Posts: 4
Joined: Wed Jul 14, 2010 8:31 am
Location: Italy

Post by Keyosz »

Post Reply