If you want more info on lighting here is a good link:
http://www.sjbaker.org/steve/omniv/opengl_lighting.html
So...
- set smooth on a mesh to make it smooth!
- the first colour "col" is diffuse colour
- use very low or zero specular "spe" colour
The .obj exporter seems to use some world ambient colour, I couldn't find how to change this in blender. But maybe someone else can??
For the time being you can change these lines in the .obj exporter so you can set ambient colour:
file.write('Ka %.6f %.6f %.6f\n' % tuple([c*mat.getAmb() for c in worldAmb]) ) # Ambient, uses mirror colour,
to
file.write('Ka %.6f %.6f %.6f\n' % tuple([c for c in mat.getMirCol()]) ) # Ambient, uses mirror colour,
Now the mirror colour in blender's material will be used as ambient.
- When exporting make sure to select the "Normals" button.
- And by default it exports only selected meshes so either select them all or deselect the "Selection Only" button.
- once in irrlicht you can set the ambient lighting:
device->getVideoDriver()->setAmbientLight(video::SColorf(0.5,0.5,0.5));
- or create a sun style directional light
the following light seems to work okay for me:
Code: Select all
irr::scene::ILightSceneNode *light = device->getSceneManager()->addLightSceneNode(NULL, irr::core::vector3df(0,1,0));
irr::video::SLight &slight = light->getLightData();
slight.Type = video::ELT_DIRECTIONAL;
slight.DiffuseColor = irr::video::SColorf(1.0,1.0,1.0,1.0);
slight.AmbientColor = irr::video::SColorf(0.4,0.4,0.4,1.0);
slight.SpecularColor = irr::video::SColorf(1.0,1.0,1.0,1.0);