PDA

View Full Version : Irrlicht 3d problem, ambient light - primitives count



yohanip
03-12-2012, 10:45 PM
Hi all :)
i'm learning the beautifull 3d irrlicht library through proton
but i have across some troubles

when running a simple loading 2 model (x model exported from blender) using an ISceneManager's ambient light, and two lights produce different result. Seems like the light and ambient is neglected although i had set the lighting in material to true

However testing directly using the Irrlicht 1.71 without proton, using opengl driver produce satisfactory a nice result, the ambient is showing, the light appears

maybe there is something i miss to setup using proton+irrlicht correctly?

Any help and advice much appreciated :D thanks! :D

Ps. I also notice the primitives count is never stop (the information bar when running which shows FPS, primitives, Memmories, etc), it's increasing along with time.. mine was reaching almost 2 million for the scene i'm composing

here is a snippet for the setting up both in proton and in plain irrlicht without proton

//adding the camera
cam = smgr->addCameraSceneNode(0, core::vector3df(0, 4.0f, -6.0f), core::vector3df(0,0,0));

//loading nodes here..
platform_full = smgr->getMesh((GetBaseAppPath() + "world/platform-baked.x").c_str());
//add the platform node...
scene::IAnimatedMeshSceneNode *nd = smgr->addAnimatedMeshSceneNode(platform_full);
//material..
nd->setMaterialFlag(video::EMF_LIGHTING, true);

//adding the actor..
scene::IAnimatedMesh *actor_mesh = smgr->getMesh((GetBaseAppPath() + "world/actor.x").c_str());
//add the actor node...
actor = smgr->addAnimatedMeshSceneNode(actor_mesh);
actor->setMaterialFlag(video::EMF_LIGHTING, true);

actor->setPosition(core::vector3df(0, 1, 0));

scene::ISceneNodeAnimator* anim = smgr->createFlyStraightAnimator(core::vector3df(0,1,-2.5f), core::vector3df(0,1,2.5f), 1000, true, true);
actor->addAnimator(anim);
anim->drop();

//cyrcling node..
anim = smgr->createRotationAnimator(core::vector3df(3, 0, 0));
actor->addAnimator(anim);
anim->drop();

actor_light = smgr->addLightSceneNode(0, core::vector3df(5, 5, 5));
//actor_light2 = smgr->addLightSceneNode(0, core::vector3df(5, 5, 5));

smgr->setAmbientLight(video::SColorf(0.3f, 0.3f, 0.3f, 1.0f));

yohanip
03-12-2012, 10:54 PM
This one is only Irrlicht
740

This one is the irrlicht+proton
741

maybe i forget some settings.. but i couldn't find which or how to set 'em :(

Seth
03-12-2012, 10:56 PM
Hi all :)
i'm learning the beautifull 3d irrlicht library through proton
but i have across some troubles

when running a simple loading 2 model (x model exported from blender) using an ISceneManager's ambient light, and two lights produce different result. Seems like the light and ambient is neglected although i had set the lighting in material to true

However testing directly using the Irrlicht 1.71 without proton, using opengl driver produce satisfactory a nice result, the ambient is showing, the light appears

maybe there is something i miss to setup using proton+irrlicht correctly?

Any help and advice much appreciated :D thanks! :D

Ps. I also notice the primitives count is never stop (the information bar when running which shows FPS, primitives, Memmories, etc), it's increasing along with time.. mine was reaching almost 2 million for the scene i'm composing

here is a snippet for the setting up both in proton and in plain irrlicht without proton

//adding the camera
cam = smgr->addCameraSceneNode(0, core::vector3df(0, 4.0f, -6.0f), core::vector3df(0,0,0));

//loading nodes here..
platform_full = smgr->getMesh((GetBaseAppPath() + "world/platform-baked.x").c_str());
//add the platform node...
scene::IAnimatedMeshSceneNode *nd = smgr->addAnimatedMeshSceneNode(platform_full);
//material..
nd->setMaterialFlag(video::EMF_LIGHTING, true);

//adding the actor..
scene::IAnimatedMesh *actor_mesh = smgr->getMesh((GetBaseAppPath() + "world/actor.x").c_str());
//add the actor node...
actor = smgr->addAnimatedMeshSceneNode(actor_mesh);
actor->setMaterialFlag(video::EMF_LIGHTING, true);

actor->setPosition(core::vector3df(0, 1, 0));

scene::ISceneNodeAnimator* anim = smgr->createFlyStraightAnimator(core::vector3df(0,1,-2.5f), core::vector3df(0,1,2.5f), 1000, true, true);
actor->addAnimator(anim);
anim->drop();

//cyrcling node..
anim = smgr->createRotationAnimator(core::vector3df(3, 0, 0));
actor->addAnimator(anim);
anim->drop();

actor_light = smgr->addLightSceneNode(0, core::vector3df(5, 5, 5));
//actor_light2 = smgr->addLightSceneNode(0, core::vector3df(5, 5, 5));

smgr->setAmbientLight(video::SColorf(0.3f, 0.3f, 0.3f, 1.0f));


Oops, thanks for mentioning the debug prim counter bug, will fix.

With the lighting problem, is this using Proton in GLES or GL mode?

Be sure to do GetIrrlichtManager()->SetLightingEnabled(true); if you will be using lighting.

yohanip
03-13-2012, 02:50 AM
Oops, thanks for mentioning the debug prim counter bug, will fix.

With the lighting problem, is this using Proton in GLES or GL mode?

Be sure to do GetIrrlichtManager()->SetLightingEnabled(true); if you will be using lighting.

It is curently using the GL Mode,
Thank you very much!
GetIrrlichtManager()->SetLightingEnabled(true); does the job very good! :D
ahh yes, i should have consult the source code.. lesson learned.. :sweatdrop: