dynamic lights
Posted: Wed Feb 27, 2008 3:09 pm
Im using a quake3 map(made one from scratch, having some trouble with lightmaps) and im using dynamic lights on it. Which seem to work but no really correctly.
code we use for the lights
we use that code to generate dynamic lights from the maps info, right now we have 4 lights placed out on the map.
Here are some screenshots
http://stefans.damnserver.com/screen1.jpg
http://stefans.damnserver.com/screen2.jpg
Here you can see how the light fligh around in a cirlce effect the walls very strange.
Anyone has any idea how to fix or another way to implement dynamic lights with Irrlicht.
thx[/img]
code we use for the lights
Code: Select all
mLevelNode->setMaterialFlag( video::EMF_LIGHTING, true );
mLevelNode->setMaterialType( video::EMT_LIGHTMAP_LIGHTING );
mLevelNode->setMaterialFlag( video::EMF_NORMALIZE_NORMALS, true);
scene::ILightSceneNode* light = mSmgr->addLightSceneNode( 0 );
irr::video::SLight l;
l.AmbientColor = video::SColorf(1.0f, 0.0f, 0.0f);
l.DiffuseColor = video::SColorf(0.6f, 0.6f, 0.6f);
l.SpecularColor = video::SColorf(0.0f, 0.0f, 0.0f);
l.Radius = mLights[0].power;
l.Type = video::ELT_POINT;
l.Direction = core::vector3df( 0.0f,
-1.0f,
0.0f );
l.InnerCone = (float)mLights[0].innercone;
l.OuterCone = (float)mLights[0].outercone;
Here are some screenshots
http://stefans.damnserver.com/screen1.jpg
http://stefans.damnserver.com/screen2.jpg
Here you can see how the light fligh around in a cirlce effect the walls very strange.
Anyone has any idea how to fix or another way to implement dynamic lights with Irrlicht.
thx[/img]