engine lights in BSP
-
MG
engine lights in BSP
Is possible using engine lights in BSP scene (seeing lights on texture in bsp scene)?
-
[dx/x]=HUNT3R
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
Well yeah, all you do is add a light scene node:
where X,Y,Z are the corrdinates you want it at and radius is the radius of light, i.e. 1500.0f. Of course you won't be able to see the light itself, just the light that is shone on your world. So attach a billboard Scene Node that looks like a light to the Light Scene Node. BTW the lights aren't working correctly in OpenGL right now, only DirectX.
Code: Select all
scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(parent,
core::vector3df(X,Y,Z), video::SColor(255, 255, 255, 255), radius);-
MG
But when i add light to bsp scene, light not lighting 
Where i doing wrong?

Where i doing wrong?
Code: Select all
scene::ISceneNode* node_light = smgr->addLightSceneNode(0,
core::vector3df(0,60,0),
video::SColorf(1.0f, 1.0f, 1.0f, 1.0f), 1500.0f);
node_light = smgr->addBillboardSceneNode(node_light, core::dimension2d<f32>(50, 50));
node_light->setMaterialFlag(video::EMF_LIGHTING, false);
node_light->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
node_light->setMaterialTexture(0, driver->getTexture("particlewhite.bmp"));

-
[dx/x]=HUNT3R
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
I'm assuming you're using DirectX b/c I think in OpenGL it would all be lit up. But it looks like you have some light on the ceiling, just not on the floor or sides? Your code looks correct, maybe try SColor(255,255,255,255) instead of SColorf(1.0,1.0,1.0,1.0) and see if there's any change. Also, try and change the coordinates of the light, move it around and see if there's any change...
-
MG
In scene is only one light (with billboard), other 'lights' are in .bsp (textures). Can you see on this?
http://www.auto-myslivec.cz/img/irrlicht/lights.zip 500KB
Thank you
http://www.auto-myslivec.cz/img/irrlicht/lights.zip 500KB
Thank you
-
[dx/x]=HUNT3R
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
-
[dx/x]=HUNT3R
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
I did notice some things you are doing wrong. Your code for the light should look like this:
You were using the same ISceneNode for the light and the billboard. Make them separate nodes and the light should be an ILightSceneNode* and the billboard should be a IBillboardSceneNode* but strangely enough this still does not fix your problem... it must be a problem with the map.
Code: Select all
scene::ILightSceneNode* node_light = device->getSceneManager()->addLightSceneNode(0,
core::vector3df(0,80,0),
video::SColor(255,255,255,255), 5500.0f);
scene::IBillboardSceneNode* light = smgr->addBillboardSceneNode(node_light, core::dimension2d<f32>(50, 50));
light->setMaterialFlag(video::EMF_LIGHTING, false);
light->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
light->setMaterialTexture(0, driver->getTexture("particlewhite.bmp"));If you want to use dynamic lights in a lightmapped BSP, check out this topic: http://irrlicht.sourceforge.net/phpBB2/ ... c.php?t=85! In short: it isn't possible (yet) to use lightmaps and dynamic (created) lights as well...