Page 1 of 1

Dynamic lightning problem

Posted: Thu Jun 21, 2007 10:24 pm
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.

Posted: Fri Jun 22, 2007 2:46 am
by Dorth
Augment the radius of your lights just for kicks ;)

Posted: Fri Jun 22, 2007 8:07 am
by hybrid
Wrongly oriented normals (or missing ones) can also be a problem.

Posted: Fri Jun 22, 2007 2:20 pm
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?

Posted: Fri Jun 22, 2007 2:23 pm
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 ^^ .

Posted: Fri Jun 22, 2007 9:57 pm
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..

Posted: Fri Jun 22, 2007 10:15 pm
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..