Dynamic lightning problem

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
Viniterra
Posts: 12
Joined: Sun Dec 17, 2006 5:44 am

Dynamic lightning problem

Post by Viniterra »

Hi,

I have 2 animated meshes imported in .(X) format, and the level in the (.obj) format. When I add some dynamic light to the scene, the animated meshes became iluminated, but the level is completely black. Since the default flags for any node is to be iluminated, I had not setted any flag at first, excepting the EMF_NORMALIZE_NORMALS, as used in specialFx example.

Then I have setted the EMF_LIGHTING flag for true, but te problem persists. I don't think this is the problem. Does anyone has any idea of what is going on over ther?

Tanks in advance.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Augment the radius of your lights just for kicks ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Wrongly oriented normals (or missing ones) can also be a problem.
Irme
Posts: 55
Joined: Sat Jul 16, 2005 8:24 am

Post by Irme »

Actually i had this same problem .obj files the other day

It seems that they are not accepting any lighting at all. If you set your lighting flag on the node to false it will show up. instead of just being black. But that doesn't work either since everything else will be showing the light.

I suppose this should probably be a bug report?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Again, put a directional light in your scene or increase by A LOT the radius of your lights... Check for *any* changes. Also, screens and/or code would be useful ^^ .
Viniterra
Posts: 12
Joined: Sun Dec 17, 2006 5:44 am

Post by Viniterra »

I've setted the radio to 1000, 10000, and 100000
The .obj is completly black

The meshes are so much iluminated with this settings..

I'm thinking it's a BUG too..

Code: Select all


irr::scene::IAnimatedMesh *npcMesh = smgr->getMesh("media/npc.x");
irr::scene::IAnimatedMeshSceneNode *npcNode = smgr->addAnimatedMeshSceneNode(npcMesh);

irr::scene::IAnimatedMesh* levelMesh = smgr->getMesh("media/level/map.obj");
irr::scene::ISceneNode* levelNode = smgr->addOctTreeSceneNode(levelMesh);
levelNode->setScale(irr::core::vector3df(100,100,100));
levelNode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
levelNode->setMaterialFlag(EMF_LIGHTING, true);  // this line doesn't make difference

smgr->addLightSceneNode(0, core::vector3df(0,1000,0), video::SColorf(1.0f, 1.0f, 1.0f, 1.0f), 100000.0f); // light
I've also tryed to atach the light to the level, and to the animated meshes
No results..
Viniterra
Posts: 12
Joined: Sun Dec 17, 2006 5:44 am

Post by Viniterra »

I've just tryed this with .3DS, with the SAME code, just changing the file extension, and voila, the ilumination works.

So I guess it's a BUG.

Another observation, I don't know why, but the collisions are way better calculated ins the .3DS file..
Post Reply