Commit 59ac6432 authored by hybrid's avatar hybrid

Added Spot lights for hardware drivers. Added per pixel fog support for OpenGL.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@838 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8f34efc3
Changes in version 1.4 (... 2007) Changes in version 1.4 (... 2007)
- Added river support for user defined clip planes, based on mandrav's patch. - Added Spot light type for dynamic lights. Note that both position and direction for all dynamic lights are now determined by the LightSceneNode, the SLight attributes are only used for internal purposes.
API change! One can easily work around this change by setting the LightSceneNode's Position and Rotation instead of the SLight's. This change won't provoke a compile error, though, and can hence go unrecognized besides the visual problems.
The lights use a default direction (0,0,-1) which is rotated by the usual scene node transformations and can hence be modified by scene node animators.
A change in the Radius usage can lead to strange artifacts. Just increase the Radius in this case. further handling of Radius is to be discussed.
- Added per pixel fog support for OpenGL.
- Added driver support for user defined clip planes, based on mandrav's patch.
The OpenGL version is more picky about ModelView matrices, so it's best to set the projection plane at the time it is used.
- .obj files now load relative indices correctly. Collada files load textures. - .obj files now load relative indices correctly. Collada files load textures.
- A new MeshBuffer implementation is publicly available. It supports a shared vertex list for all MeshBuffers, used for MS3D meshes.
- MeshBuffers can recalculate their BoundingBoxes on their own now, no need for MeshManipulators. New append methods help to merge MeshBuffers. take care that the types match!
- The new texture generation mode is working. With ETCF_NO_ALPHA_CHANNEL textures are generated without ALPHA bits reserved.
- D3D9 hardware mipmap updates are re-enabled, problems should be reported.
- In some cases fullscreeen modes under win32 should have a better frame rate now. - In some cases fullscreeen modes under win32 should have a better frame rate now.
- Fixed the hillplane mesh to work with non-quadratic dimensions as well. Changed the interface also, so use a u32 dimension to specify the tilecount now. - Fixed the hillplane mesh to work with non-quadratic dimensions as well. Changed the interface also, so use a u32 dimension to specify the tilecount now.
......
...@@ -133,7 +133,7 @@ int main() ...@@ -133,7 +133,7 @@ int main()
We add a hello world label to the window, using the GUI environment. We add a hello world label to the window, using the GUI environment.
*/ */
guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
rect<int>(10,10,260,22), true); rect<s32>(10,10,260,22), true);
/* /*
To display something interesting, we load a Quake 2 model To display something interesting, we load a Quake 2 model
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
corner.</p> corner.</p>
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center"> <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
<tr> <tr>
<td> <pre>guienv-&gt;addStaticText(L&quot;Hello World! This is the Irrlicht Software engine!&quot;,<br> rect&lt;int&gt;(10,10,200,22), true);</pre> </td> <td> <pre>guienv-&gt;addStaticText(L&quot;Hello World! This is the Irrlicht Software engine!&quot;,<br> rect&lt;s32&gt;(10,10,200,22), true);</pre> </td>
</tr> </tr>
</table> </table>
......
...@@ -121,7 +121,7 @@ int main() ...@@ -121,7 +121,7 @@ int main()
// create light // create light
node = smgr->addLightSceneNode(0, core::vector3df(0,0,0), node = smgr->addLightSceneNode(0, core::vector3df(0,0,0),
video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 600.0f); video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 1200.0f);
scene::ISceneNodeAnimator* anim = 0; scene::ISceneNodeAnimator* anim = 0;
anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f); anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f);
node->addAnimator(anim); node->addAnimator(anim);
...@@ -248,13 +248,13 @@ int main() ...@@ -248,13 +248,13 @@ int main()
if (lastFPS != fps) if (lastFPS != fps)
{ {
core::stringw str = L"Irrlicht Engine - SpecialFX example ["; core::stringw str = L"Irrlicht Engine - SpecialFX example [";
str += driver->getName(); str += driver->getName();
str += "] FPS:"; str += "] FPS:";
str += fps; str += fps;
device->setWindowCaption(str.c_str()); device->setWindowCaption(str.c_str());
lastFPS = fps; lastFPS = fps;
} }
} }
......
/* /*
This tutorial shows how to use one of the built in more complex materials in irrlicht: This tutorial shows how to use one of the built in more complex materials in irrlicht:
Per pixel lighted surfaces using normal maps and parallax mapping. It will also show Per pixel lighted surfaces using normal maps and parallax mapping. It will also show
how to use fog and moving particle systems. And don't panic: You dont need any how to use fog and moving particle systems. And don't panic: You dont need any
experience with shaders to use these materials in Irrlicht. experience with shaders to use these materials in Irrlicht.
At first, we need to include all headers and do the stuff we always do, like At first, we need to include all headers and do the stuff we always do, like
...@@ -19,7 +19,7 @@ using namespace irr; ...@@ -19,7 +19,7 @@ using namespace irr;
/* /*
For this example, we need an event receiver, to make it possible for the user For this example, we need an event receiver, to make it possible for the user
to switch between the three available material types. In addition, the event to switch between the three available material types. In addition, the event
receiver will create some small GUI window which displays what material is receiver will create some small GUI window which displays what material is
currently being used. There is nothing special done in this class, so maybe currently being used. There is nothing special done in this class, so maybe
you want to skip reading it. you want to skip reading it.
*/ */
...@@ -27,7 +27,7 @@ class MyEventReceiver : public IEventReceiver ...@@ -27,7 +27,7 @@ class MyEventReceiver : public IEventReceiver
{ {
public: public:
MyEventReceiver(scene::ISceneNode* room, MyEventReceiver(scene::ISceneNode* room,
gui::IGUIEnvironment* env, video::IVideoDriver* driver) gui::IGUIEnvironment* env, video::IVideoDriver* driver)
{ {
// store pointer to room so we can change its drawing mode // store pointer to room so we can change its drawing mode
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
ProblemText->setOverrideColor(video::SColor(100,255,255,255)); ProblemText->setOverrideColor(video::SColor(100,255,255,255));
// set start material (prefer parallax mapping if available) // set start material (prefer parallax mapping if available)
video::IMaterialRenderer* renderer = video::IMaterialRenderer* renderer =
Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID); Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID);
if (renderer && renderer->getRenderCapability() == 0) if (renderer && renderer->getRenderCapability() == 0)
ListBox->setSelected(2); ListBox->setSelected(2);
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
if (event.EventType == irr::EET_KEY_INPUT_EVENT && if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
!event.KeyInput.PressedDown && Room && ListBox) !event.KeyInput.PressedDown && Room && ListBox)
{ {
// change selected item in listbox // change selected item in listbox
int sel = ListBox->getSelected(); int sel = ListBox->getSelected();
if (event.KeyInput.Key == irr::KEY_KEY_R) if (event.KeyInput.Key == irr::KEY_KEY_R)
...@@ -84,13 +84,13 @@ public: ...@@ -84,13 +84,13 @@ public:
else else
if (event.KeyInput.Key == irr::KEY_KEY_E) if (event.KeyInput.Key == irr::KEY_KEY_E)
--sel; --sel;
else else
return false; return false;
if (sel > 2) sel = 0; if (sel > 2) sel = 0;
if (sel < 0) sel = 2; if (sel < 0) sel = 2;
ListBox->setSelected(sel); ListBox->setSelected(sel);
// set the material which is selected in the listbox // set the material which is selected in the listbox
setMaterial(); setMaterial();
} }
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
private: private:
// sets the material of the room mesh the the one set in the // sets the material of the room mesh the the one set in the
// list box. // list box.
void setMaterial() void setMaterial()
{ {
...@@ -120,10 +120,10 @@ private: ...@@ -120,10 +120,10 @@ private:
Room->setMaterialType(type); Room->setMaterialType(type);
/* /*
We need to add a warning if the materials will not be able to be We need to add a warning if the materials will not be able to be
displayed 100% correctly. This is no problem, they will be renderered displayed 100% correctly. This is no problem, they will be renderered
using fall back materials, but at least the user should know that using fall back materials, but at least the user should know that
it would look better on better hardware. it would look better on better hardware.
We simply check if the material renderer is able to draw at full We simply check if the material renderer is able to draw at full
quality on the current hardware. The IMaterialRenderer::getRenderCapability() quality on the current hardware. The IMaterialRenderer::getRenderCapability()
returns 0 if this is the case. returns 0 if this is the case.
...@@ -142,7 +142,7 @@ private: ...@@ -142,7 +142,7 @@ private:
gui::IGUIStaticText* ProblemText; gui::IGUIStaticText* ProblemText;
gui::IGUIListBox* ListBox; gui::IGUIListBox* ListBox;
scene::ISceneNode* Room; scene::ISceneNode* Room;
video::IVideoDriver* Driver; video::IVideoDriver* Driver;
}; };
...@@ -173,7 +173,7 @@ int main() ...@@ -173,7 +173,7 @@ int main()
case 'e': driverType = video::EDT_BURNINGSVIDEO;break; case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break; case 'f': driverType = video::EDT_NULL; break;
default: return 0; default: return 0;
} }
// create device // create device
...@@ -182,16 +182,16 @@ int main() ...@@ -182,16 +182,16 @@ int main()
if (device == 0) if (device == 0)
return 1; // could not create selected driver. return 1; // could not create selected driver.
/* /*
Before we start with the interesting stuff, we do some simple things: Before we start with the interesting stuff, we do some simple things:
Store pointers to the most important parts of the engine (video driver, Store pointers to the most important parts of the engine (video driver,
scene manager, gui environment) to safe us from typing too much, scene manager, gui environment) to safe us from typing too much,
add an irrlicht engine logo to the window and a user controlled add an irrlicht engine logo to the window and a user controlled
first person shooter style camera. Also, we let the engine now first person shooter style camera. Also, we let the engine now
that it should store all textures in 32 bit. This necessary because that it should store all textures in 32 bit. This necessary because
for parallax mapping, we need 32 bit textures. for parallax mapping, we need 32 bit textures.
*/ */
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneManager* smgr = device->getSceneManager();
...@@ -202,9 +202,9 @@ int main() ...@@ -202,9 +202,9 @@ int main()
// add irrlicht logo // add irrlicht logo
env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"),
core::position2d<s32>(10,10)); core::position2d<s32>(10,10));
// add camera // add camera
scene::ICameraSceneNode* camera = scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0,100.0f,300.0f); smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
camera->setPosition(core::vector3df(-200,200,-200)); camera->setPosition(core::vector3df(-200,200,-200));
...@@ -213,7 +213,7 @@ int main() ...@@ -213,7 +213,7 @@ int main()
/* /*
Because we want the whole scene to look a little bit scarier, we add some fog Because we want the whole scene to look a little bit scarier, we add some fog
to it. This is done by a call to IVideoDriver::setFog(). There you can set to it. This is done by a call to IVideoDriver::setFog(). There you can set
various fog settings. In this example, we use pixel fog, because it will various fog settings. In this example, we use pixel fog, because it will
work well with the materials we'll use in this example. work well with the materials we'll use in this example.
...@@ -224,7 +224,7 @@ int main() ...@@ -224,7 +224,7 @@ int main()
/* /*
To be able to display something interesting, we load a mesh from a .3ds file To be able to display something interesting, we load a mesh from a .3ds file
which is a room I modeled with anim8or. It is the same room as which is a room I modeled with anim8or. It is the same room as
from the specialFX example. Maybe you remember from that tutorial, from the specialFX example. Maybe you remember from that tutorial,
I am no good modeler at all and so I totally messed up the texture I am no good modeler at all and so I totally messed up the texture
mapping in this model, but we can simply repair it with the mapping in this model, but we can simply repair it with the
...@@ -240,9 +240,9 @@ int main() ...@@ -240,9 +240,9 @@ int main()
smgr->getMeshManipulator()->makePlanarTextureMapping( smgr->getMeshManipulator()->makePlanarTextureMapping(
roomMesh->getMesh(0), 0.003f); roomMesh->getMesh(0), 0.003f);
/* /*
Now for the first exciting thing: If we successfully loaded the mesh Now for the first exciting thing: If we successfully loaded the mesh
we need to apply textures to it. Because we want this room to be we need to apply textures to it. Because we want this room to be
displayed with a very cool material, we have to do a little bit more displayed with a very cool material, we have to do a little bit more
than just set the textures. Instead of only loading a color map as usual, than just set the textures. Instead of only loading a color map as usual,
we also load a height map which is simply a grayscale texture. From this we also load a height map which is simply a grayscale texture. From this
...@@ -252,11 +252,11 @@ int main() ...@@ -252,11 +252,11 @@ int main()
The normal map texture is being generated by the makeNormalMapTexture method The normal map texture is being generated by the makeNormalMapTexture method
of the VideoDriver. The second parameter specifies the height of the heightmap. of the VideoDriver. The second parameter specifies the height of the heightmap.
If you set it to a bigger value, the map will look more rocky. If you set it to a bigger value, the map will look more rocky.
*/ */
video::ITexture* colorMap = driver->getTexture("../../media/rockwall.bmp"); video::ITexture* colorMap = driver->getTexture("../../media/rockwall.bmp");
video::ITexture* normalMap = driver->getTexture("../../media/rockwall_height.bmp"); video::ITexture* normalMap = driver->getTexture("../../media/rockwall_height.bmp");
driver->makeNormalMapTexture(normalMap, 9.0f); driver->makeNormalMapTexture(normalMap, 9.0f);
/* /*
...@@ -264,7 +264,7 @@ int main() ...@@ -264,7 +264,7 @@ int main()
use needs some additional informations per vertex like tangents and binormals. use needs some additional informations per vertex like tangents and binormals.
Because we are too lazy to calculate that information now, we let Irrlicht do Because we are too lazy to calculate that information now, we let Irrlicht do
this for us. That's why we call IMeshManipulator::createMeshWithTangents(). It this for us. That's why we call IMeshManipulator::createMeshWithTangents(). It
creates a mesh copy with tangents and binormals from any other mesh. creates a mesh copy with tangents and binormals from any other mesh.
After we've done that, we simply create a standard mesh scene node with this After we've done that, we simply create a standard mesh scene node with this
mesh copy, set color and normal map and adjust some other material settings. mesh copy, set color and normal map and adjust some other material settings.
Note that we set EMF_FOG_ENABLE to true to enable fog in the room. Note that we set EMF_FOG_ENABLE to true to enable fog in the room.
...@@ -280,7 +280,7 @@ int main() ...@@ -280,7 +280,7 @@ int main()
room->getMaterial(0).SpecularColor.set(0,0,0,0); room->getMaterial(0).SpecularColor.set(0,0,0,0);
room->setMaterialFlag(video::EMF_FOG_ENABLE, true); room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID); room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
room->getMaterial(0).MaterialTypeParam = 0.035f; // adjust height for parallax effect room->getMaterial(0).MaterialTypeParam = 0.035f; // adjust height for parallax effect
// drop mesh because we created it with a create.. call. // drop mesh because we created it with a create.. call.
...@@ -291,8 +291,8 @@ int main() ...@@ -291,8 +291,8 @@ int main()
After we've created a room shaded by per pixel lighting, we add a sphere After we've created a room shaded by per pixel lighting, we add a sphere
into it with the same material, but we'll make it transparent. In addition, into it with the same material, but we'll make it transparent. In addition,
because the sphere looks somehow like a familiar planet, we make it rotate. because the sphere looks somehow like a familiar planet, we make it rotate.
The procedure is similar as before. The difference is that we are loading The procedure is similar as before. The difference is that we are loading
the mesh from an .x file which already contains a color map so we do not the mesh from an .x file which already contains a color map so we do not
need to load it manually. But the sphere is a little bit too small for our need to load it manually. But the sphere is a little bit too small for our
needs, so we scale it by the factor 50. needs, so we scale it by the factor 50.
*/ */
...@@ -306,12 +306,12 @@ int main() ...@@ -306,12 +306,12 @@ int main()
scene::IMeshManipulator *manipulator = smgr->getMeshManipulator(); scene::IMeshManipulator *manipulator = smgr->getMeshManipulator();
// create mesh copy with tangent informations from original earth.x mesh // create mesh copy with tangent informations from original earth.x mesh
scene::IMesh* tangentSphereMesh = scene::IMesh* tangentSphereMesh =
manipulator->createMeshWithTangents(earthMesh->getMesh(0)); manipulator->createMeshWithTangents(earthMesh->getMesh(0));
// set the alpha value of all vertices to 200 // set the alpha value of all vertices to 200
manipulator->setVertexColorAlpha(tangentSphereMesh, 200); manipulator->setVertexColorAlpha(tangentSphereMesh, 200);
// scale the mesh by factor 50 // scale the mesh by factor 50
core::matrix4 m; core::matrix4 m;
m.setScale ( core::vector3df(50,50,50) ); m.setScale ( core::vector3df(50,50,50) );
...@@ -328,11 +328,11 @@ int main() ...@@ -328,11 +328,11 @@ int main()
// adjust material settings // adjust material settings
sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true); sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true);
sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA); sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA);
// add rotation animator // add rotation animator
scene::ISceneNodeAnimator* anim = scene::ISceneNodeAnimator* anim =
smgr->createRotationAnimator(core::vector3df(0,0.1f,0)); smgr->createRotationAnimator(core::vector3df(0,0.1f,0));
sphere->addAnimator(anim); sphere->addAnimator(anim);
anim->drop(); anim->drop();
...@@ -342,25 +342,25 @@ int main() ...@@ -342,25 +342,25 @@ int main()
/* /*
Per pixel lighted materials only look cool when there are moving lights. So we Per pixel lighted materials only look cool when there are moving lights. So we
add some. And because moving lights alone are so boring, we add billboards add some. And because moving lights alone are so boring, we add billboards
to them, and a whole particle system to one of them. to them, and a whole particle system to one of them.
We start with the first light which is red and has only the billboard attached. We start with the first light which is red and has only the billboard attached.
*/ */
// add light 1 (nearly red) // add light 1 (nearly red)
scene::ILightSceneNode* light1 = scene::ILightSceneNode* light1 =
smgr->addLightSceneNode(0, core::vector3df(0,0,0), smgr->addLightSceneNode(0, core::vector3df(0,0,0),
video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f); video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 800.0f);
// add fly circle animator to light 1 // add fly circle animator to light 1
scene::ISceneNodeAnimator* anim = scene::ISceneNodeAnimator* anim =
smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f); smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f);
light1->addAnimator(anim); light1->addAnimator(anim);
anim->drop(); anim->drop();
// attach billboard to the light // attach billboard to the light
scene::ISceneNode* bill = scene::ISceneNode* bill =
smgr->addBillboardSceneNode(light1, core::dimension2d<f32>(60, 60)); smgr->addBillboardSceneNode(light1, core::dimension2d<f32>(60, 60));
bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialFlag(video::EMF_LIGHTING, false);
...@@ -370,22 +370,22 @@ int main() ...@@ -370,22 +370,22 @@ int main()
/* /*
Now the same again, with the second light. The difference is that we add a particle Now the same again, with the second light. The difference is that we add a particle
system to it too. And because the light moves, the particles of the particlesystem system to it too. And because the light moves, the particles of the particlesystem
will follow. If you want to know more about how particle systems are created in will follow. If you want to know more about how particle systems are created in
Irrlicht, take a look at the specialFx example. Irrlicht, take a look at the specialFx example.
Maybe you will have noticed that we only add 2 lights, this has a simple reason: The Maybe you will have noticed that we only add 2 lights, this has a simple reason: The
low end version of this material was written in ps1.1 and vs1.1, which doesn't allow low end version of this material was written in ps1.1 and vs1.1, which doesn't allow
more lights. You could add a third light to the scene, but it won't be used to more lights. You could add a third light to the scene, but it won't be used to
shade the walls. But of course, this will change in future versions of Irrlicht were shade the walls. But of course, this will change in future versions of Irrlicht were
higher versions of pixel/vertex shaders will be implemented too. higher versions of pixel/vertex shaders will be implemented too.
*/ */
// add light 2 (gray) // add light 2 (gray)
scene::ISceneNode* light2 = scene::ISceneNode* light2 =
smgr->addLightSceneNode(0, core::vector3df(0,0,0), smgr->addLightSceneNode(0, core::vector3df(0,0,0),
video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 200.0f); video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 800.0f);
// add fly circle animator to light 2 // add fly circle animator to light 2
anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),200.0f, 0.001f, core::vector3df ( 0.2f, 0.9f, 0.f )); anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),200.0f, 0.001f, core::vector3df ( 0.2f, 0.9f, 0.f ));
light2->addAnimator(anim); light2->addAnimator(anim);
anim->drop(); anim->drop();
...@@ -396,16 +396,16 @@ int main() ...@@ -396,16 +396,16 @@ int main()
bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp")); bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp"));
// add particle system // add particle system
scene::IParticleSystemSceneNode* ps = scene::IParticleSystemSceneNode* ps =
smgr->addParticleSystemSceneNode(false, light2); smgr->addParticleSystemSceneNode(false, light2);
ps->setParticleSize(core::dimension2d<f32>(30.0f, 40.0f)); ps->setParticleSize(core::dimension2d<f32>(30.0f, 40.0f));
// create and set emitter // create and set emitter
scene::IParticleEmitter* em = ps->createBoxEmitter( scene::IParticleEmitter* em = ps->createBoxEmitter(
core::aabbox3d<f32>(-3,0,-3,3,1,3), core::aabbox3d<f32>(-3,0,-3,3,1,3),
core::vector3df(0.0f,0.03f,0.0f), core::vector3df(0.0f,0.03f,0.0f),
80,100, 80,100,
video::SColor(0,255,255,255), video::SColor(0,255,255,255), video::SColor(0,255,255,255), video::SColor(0,255,255,255),
400,1100); 400,1100);
ps->setEmitter(em); ps->setEmitter(em);
...@@ -424,7 +424,7 @@ int main() ...@@ -424,7 +424,7 @@ int main()
MyEventReceiver receiver(room, env, driver); MyEventReceiver receiver(room, env, driver);
device->setEventReceiver(&receiver); device->setEventReceiver(&receiver);
/* /*
Finally, draw everything. That's it. Finally, draw everything. That's it.
*/ */
...@@ -445,18 +445,18 @@ int main() ...@@ -445,18 +445,18 @@ int main()
if (lastFPS != fps) if (lastFPS != fps)
{ {
core::stringw str = L"Per pixel lighting example - Irrlicht Engine ["; core::stringw str = L"Per pixel lighting example - Irrlicht Engine [";
str += driver->getName(); str += driver->getName();
str += "] FPS:"; str += "] FPS:";
str += fps; str += fps;
device->setWindowCaption(str.c_str()); device->setWindowCaption(str.c_str());
lastFPS = fps; lastFPS = fps;
} }
} }
device->drop(); device->drop();
return 0; return 0;
} }
...@@ -35,12 +35,12 @@ public: ...@@ -35,12 +35,12 @@ public:
irr::scene::ILightSceneNode* l = (irr::scene::ILightSceneNode*) node; irr::scene::ILightSceneNode* l = (irr::scene::ILightSceneNode*) node;
core::vector3df now = l->getPosition();
if ( ToFollow ) if ( ToFollow )
{ {
core::vector3df now = l->getPosition();
now += ToFollow->getBoundingBox().getCenter(); now += ToFollow->getBoundingBox().getCenter();
now += Offset; now += Offset;
l->setPosition(now);
} }
irr::video::SColorHSL color; irr::video::SColorHSL color;
...@@ -52,7 +52,6 @@ public: ...@@ -52,7 +52,6 @@ public:
video::SLight light = l->getLightData(); video::SLight light = l->getLightData();
light.DiffuseColor = rgb; light.DiffuseColor = rgb;
light.Position = now;
l->setLightData(light); l->setLightData(light);
} }
......
...@@ -39,7 +39,7 @@ int main() ...@@ -39,7 +39,7 @@ int main()
case 'b': driverType = video::EDT_DIRECT3D8;break; case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break; case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break; case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_SOFTWARE2;break; case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break; case 'f': driverType = video::EDT_NULL; break;
default: return 0; default: return 0;
} }
......
...@@ -34,8 +34,11 @@ public: ...@@ -34,8 +34,11 @@ public:
//! Gets the light data associated with this ILightSceneNode //! Gets the light data associated with this ILightSceneNode
//! \return Returns the light data. //! \return Returns the light data.
virtual video::SLight& getLightData() = 0; virtual const video::SLight& getLightData() const = 0;
//! Gets the light data associated with this ILightSceneNode
//! \return Returns the light data.
virtual video::SLight& getLightData() = 0;
}; };
} // end namespace scene } // end namespace scene
......
...@@ -17,7 +17,8 @@ enum E_LIGHT_TYPE ...@@ -17,7 +17,8 @@ enum E_LIGHT_TYPE
{ {
//! point light, it has a position in space and radiates light in all directions //! point light, it has a position in space and radiates light in all directions
ELT_POINT, ELT_POINT,
//! spot light, it has a position in space, a direction, and a limited cone of influence
ELT_SPOT,
//! directional light, coming from a direction from an infinite distance //! directional light, coming from a direction from an infinite distance
ELT_DIRECTIONAL ELT_DIRECTIONAL
}; };
...@@ -26,20 +27,21 @@ enum E_LIGHT_TYPE ...@@ -26,20 +27,21 @@ enum E_LIGHT_TYPE
const c8* const LightTypeNames[] = const c8* const LightTypeNames[] =
{ {
"Point", "Point",
"Spot",
"Directional", "Directional",
0 0
}; };
//! structure for holding data describing a dynamic point light. //! structure for holding data describing a dynamic point light.
/** ambient light and point lights are the only light supported /** Irrlicht supports point lights, spot lights, and directional lights.
by the irrlicht engine.
*/ */
struct SLight struct SLight
{ {
SLight() : AmbientColor(0.0f,0.0f,0.0f), DiffuseColor(1.0f, 1.0f, 1.0f), SLight() : AmbientColor(0.0f,0.0f,0.0f), DiffuseColor(1.0f,1.0f,1.0f),
SpecularColor(1.0f,1.0f,1.0f), Position(0.0f, 0.0f, 0.0f), SpecularColor(1.0f,1.0f,1.0f), Attenuation(1.0f,0.0f,0.0f),
Attenuation(1.0f, 0.0f, 0.0f), Radius(100.0f), Radius(100.0f), OuterCone(45.0f), InnerCone(0.0f),
CastShadows(true), Type(ELT_POINT) Falloff(2.0f), CastShadows(true), Type(ELT_POINT),
Position(0.0f,0.0f,0.0f), Direction(0.0f,0.0f,1.0f)
{}; {};
//! Ambient color emitted by the light //! Ambient color emitted by the light
...@@ -53,20 +55,32 @@ struct SLight ...@@ -53,20 +55,32 @@ struct SLight
/** For details how to use specular highlights, see SMaterial::Shininess */ /** For details how to use specular highlights, see SMaterial::Shininess */
SColorf SpecularColor; SColorf SpecularColor;
//! Position of the light. If Type is ELT_DIRECTIONAL, this is the direction vector the light is coming from.
core::vector3df Position;
//! Attenuation factors //! Attenuation factors
core::vector3df Attenuation; core::vector3df Attenuation;
//! Radius of light. Everything within this radius be be lighted. //! Radius of light. Everything within this radius be be lighted.
f32 Radius; f32 Radius;
//! The angle of the spot's outer cone. Ignored for other lights.
f32 OuterCone;
//! The angle of the spot's inner cone. Ignored for other lights.
f32 InnerCone;
//! The light strength's decrease between Outer and Inner cone.
f32 Falloff;
//! Does the light cast shadows? //! Does the light cast shadows?
bool CastShadows; bool CastShadows;
//! Type of the light. Default: ELT_POINT //! Type of the light. Default: ELT_POINT
E_LIGHT_TYPE Type; E_LIGHT_TYPE Type;
//! Read-ONLY! Position of the light. If Type is ELT_DIRECTIONAL, this is ignored.
core::vector3df Position;
//! Read-ONLY! Direction of the light. If Type is ELT_POINT, this is ignored.
core::vector3df Direction;
}; };
} // end namespace video } // end namespace video
......
...@@ -1693,27 +1693,36 @@ void CD3D8Driver::addDynamicLight(const SLight& dl) ...@@ -1693,27 +1693,36 @@ void CD3D8Driver::addDynamicLight(const SLight& dl)
D3DLIGHT8 light; D3DLIGHT8 light;
if ( dl.Type == ELT_POINT ) switch (dl.Type)
{ {
case ELT_POINT:
light.Type = D3DLIGHT_POINT; light.Type = D3DLIGHT_POINT;
light.Position = *(D3DVECTOR*)((void*)(&dl.Position)); break;
} case ELT_SPOT:
else light.Type = D3DLIGHT_SPOT;
if ( dl.Type == ELT_DIRECTIONAL ) break;
{ case ELT_DIRECTIONAL:
light.Type = D3DLIGHT_DIRECTIONAL; light.Type = D3DLIGHT_DIRECTIONAL;
light.Direction = *(D3DVECTOR*)((void*)(&dl.Position)); break;
} }
light.Position = *(D3DVECTOR*)((void*)(&dl.Position));
light.Direction = *(D3DVECTOR*)((void*)(&dl.Direction));
light.Range = core::min_(dl.Radius, MaxLightDistance);
light.Falloff = dl.Falloff;
light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor)); light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor));
light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor)); light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor));
light.Ambient = *(D3DCOLORVALUE*)((void*)(&dl.AmbientColor)); light.Ambient = *(D3DCOLORVALUE*)((void*)(&dl.AmbientColor));
light.Range = MaxLightDistance;
light.Attenuation0 = dl.Attenuation.X; light.Attenuation0 = dl.Attenuation.X;
light.Attenuation1 = dl.Attenuation.Y; light.Attenuation1 = dl.Attenuation.Y;
light.Attenuation2 = dl.Attenuation.Z; light.Attenuation2 = dl.Attenuation.Z;
light.Theta = dl.InnerCone * 2.0f * core::DEGTORAD;
light.Phi = dl.OuterCone * 2.0f * core::DEGTORAD;
++LastSetLight; ++LastSetLight;
pID3DDevice->SetLight(LastSetLight, &light); pID3DDevice->SetLight(LastSetLight, &light);
pID3DDevice->LightEnable(LastSetLight, true); pID3DDevice->LightEnable(LastSetLight, true);
......
...@@ -1687,19 +1687,24 @@ void CD3D9Driver::addDynamicLight(const SLight& dl) ...@@ -1687,19 +1687,24 @@ void CD3D9Driver::addDynamicLight(const SLight& dl)
D3DLIGHT9 light; D3DLIGHT9 light;
if ( dl.Type == ELT_POINT ) switch (dl.Type)
{ {
case ELT_POINT:
light.Type = D3DLIGHT_POINT; light.Type = D3DLIGHT_POINT;
light.Position = *(D3DVECTOR*)((void*)(&dl.Position)); break;
} case ELT_SPOT:
else light.Type = D3DLIGHT_SPOT;
if ( dl.Type == ELT_DIRECTIONAL ) break;
{ case ELT_DIRECTIONAL:
light.Type = D3DLIGHT_DIRECTIONAL; light.Type = D3DLIGHT_DIRECTIONAL;
light.Direction = *(D3DVECTOR*)((void*)(&dl.Position)); break;
} }
light.Range = MaxLightDistance; light.Position = *(D3DVECTOR*)((void*)(&dl.Position));
light.Direction = *(D3DVECTOR*)((void*)(&dl.Direction));
light.Range = core::min_(dl.Radius, MaxLightDistance);
light.Falloff = dl.Falloff;
light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor)); light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor));
light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor)); light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor));
...@@ -1709,6 +1714,9 @@ void CD3D9Driver::addDynamicLight(const SLight& dl) ...@@ -1709,6 +1714,9 @@ void CD3D9Driver::addDynamicLight(const SLight& dl)
light.Attenuation1 = dl.Attenuation.Y; light.Attenuation1 = dl.Attenuation.Y;
light.Attenuation2 = dl.Attenuation.Z; light.Attenuation2 = dl.Attenuation.Z;
light.Theta = dl.InnerCone * 2.0f * core::DEGTORAD;
light.Phi = dl.OuterCone * 2.0f * core::DEGTORAD;
++LastSetLight; ++LastSetLight;
pID3DDevice->SetLight(LastSetLight, &light); pID3DDevice->SetLight(LastSetLight, &light);
pID3DDevice->LightEnable(LastSetLight, true); pID3DDevice->LightEnable(LastSetLight, true);
......
...@@ -28,10 +28,8 @@ CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, ...@@ -28,10 +28,8 @@ CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
// set some useful specular color // set some useful specular color
LightData.SpecularColor = color.getInterpolated(video::SColor(255,255,255,255),0.7f); LightData.SpecularColor = color.getInterpolated(video::SColor(255,255,255,255),0.7f);
}
CLightSceneNode::~CLightSceneNode() doLightRecalc();
{
} }
...@@ -65,18 +63,17 @@ void CLightSceneNode::render() ...@@ -65,18 +63,17 @@ void CLightSceneNode::render()
switch ( LightData.Type ) switch ( LightData.Type )
{ {
case video::ELT_POINT: case video::ELT_POINT:
case video::ELT_SPOT:
driver->draw3DBox(BBox, LightData.DiffuseColor.toSColor()); driver->draw3DBox(BBox, LightData.DiffuseColor.toSColor());
break; break;
case video::ELT_DIRECTIONAL: case video::ELT_DIRECTIONAL:
driver->draw3DLine(core::vector3df( 0.f, 0.f, 0.f ), driver->draw3DLine(core::vector3df(0.f, 0.f, 0.f),
core::vector3df( 0.f, 0.f, 0.f ) + (LightData.Position * 10.f ), LightData.Direction * LightData.Radius,
LightData.DiffuseColor.toSColor() LightData.DiffuseColor.toSColor());
);
break; break;
} }
} }
driver->addDynamicLight(LightData); driver->addDynamicLight(LightData);
} }
...@@ -85,8 +82,13 @@ void CLightSceneNode::render() ...@@ -85,8 +82,13 @@ void CLightSceneNode::render()
void CLightSceneNode::setLightData(const video::SLight& light) void CLightSceneNode::setLightData(const video::SLight& light)
{ {
LightData = light; LightData = light;
ISceneNode::setPosition(light.Position); }
ISceneNode::updateAbsolutePosition();
//! \return Returns the light data.
const video::SLight& CLightSceneNode::getLightData() const
{
return LightData;
} }
...@@ -106,39 +108,28 @@ const core::aabbox3d<f32>& CLightSceneNode::getBoundingBox() const ...@@ -106,39 +108,28 @@ const core::aabbox3d<f32>& CLightSceneNode::getBoundingBox() const
void CLightSceneNode::doLightRecalc() void CLightSceneNode::doLightRecalc()
{ {
switch ( LightData.Type ) if ((LightData.Type == video::ELT_SPOT) || (LightData.Type == video::ELT_DIRECTIONAL))
{ {
case video::ELT_POINT: LightData.Direction = core::vector3df(.0f,.0f,1.0f);
{ getAbsoluteTransformation().rotateVect(LightData.Direction);
f32 r = LightData.Radius * LightData.Radius * 0.5f; LightData.Direction.normalize();
BBox.MaxEdge.set( r, r, r ); }
BBox.MinEdge.set( -r, -r, -r ); if ((LightData.Type == video::ELT_SPOT) || (LightData.Type == video::ELT_POINT))
setAutomaticCulling( scene::EAC_BOX ); {
const f32 r = LightData.Radius * LightData.Radius * 0.5f;
LightData.Position = getAbsolutePosition(); BBox.MaxEdge.set( r, r, r );
} break; BBox.MinEdge.set( -r, -r, -r );
setAutomaticCulling( scene::EAC_BOX );
case video::ELT_DIRECTIONAL: LightData.Position = getAbsolutePosition();
BBox.reset( 0, 0, 0 ); }
setAutomaticCulling( scene::EAC_OFF ); if (LightData.Type == video::ELT_DIRECTIONAL)
{
// misuse Position as direction.. BBox.reset( 0, 0, 0 );
LightData.Position = getAbsolutePosition(); setAutomaticCulling( scene::EAC_OFF );
LightData.Position.invert();
if ( LightData.Position.getLengthSQ() == 0.0 )
{
LightData.Position.set( 0.f, -1.f, 0.f );
os::Printer::log( "Invalid Directional Light Direction" );
}
else
{
LightData.Position.normalize();
}
break;
} }
} }
//! Writes attributes of the scene node. //! Writes attributes of the scene node.
void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options)
{ {
...@@ -149,6 +140,9 @@ void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeRe ...@@ -149,6 +140,9 @@ void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeRe
out->addColorf ("SpecularColor", LightData.SpecularColor); out->addColorf ("SpecularColor", LightData.SpecularColor);
out->addVector3d("Attenuation", LightData.Attenuation); out->addVector3d("Attenuation", LightData.Attenuation);
out->addFloat ("Radius", LightData.Radius); out->addFloat ("Radius", LightData.Radius);
out->addFloat ("OuterCone", LightData.OuterCone);
out->addFloat ("InnerCone", LightData.InnerCone);
out->addFloat ("Falloff", LightData.Falloff);
out->addBool ("CastShadows", LightData.CastShadows); out->addBool ("CastShadows", LightData.CastShadows);
out->addEnum ("LightType", LightData.Type, video::LightTypeNames); out->addEnum ("LightType", LightData.Type, video::LightTypeNames);
} }
...@@ -160,7 +154,13 @@ void CLightSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeR ...@@ -160,7 +154,13 @@ void CLightSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeR
LightData.DiffuseColor = in->getAttributeAsColorf("DiffuseColor"); LightData.DiffuseColor = in->getAttributeAsColorf("DiffuseColor");
LightData.SpecularColor = in->getAttributeAsColorf("SpecularColor"); LightData.SpecularColor = in->getAttributeAsColorf("SpecularColor");
if (in->existsAttribute("Attenuation")) // might not exist in older files if (in->existsAttribute("Attenuation")) // might not exist in older files
LightData.Attenuation = in->getAttributeAsVector3d("Attenuation"); LightData.Attenuation = in->getAttributeAsVector3d("Attenuation");
if (in->existsAttribute("OuterCone")) // might not exist in older files
LightData.OuterCone = in->getAttributeAsFloat("OuterCone");
if (in->existsAttribute("InnerCone")) // might not exist in older files
LightData.InnerCone = in->getAttributeAsFloat("InnerCone");
if (in->existsAttribute("Falloff")) // might not exist in older files
LightData.Falloff = in->getAttributeAsFloat("Falloff");
LightData.Radius = in->getAttributeAsFloat("Radius"); LightData.Radius = in->getAttributeAsFloat("Radius");
LightData.CastShadows = in->getAttributeAsBool("CastShadows"); LightData.CastShadows = in->getAttributeAsBool("CastShadows");
LightData.Type = (video::E_LIGHT_TYPE)in->getAttributeAsEnumeration("LightType", video::LightTypeNames); LightData.Type = (video::E_LIGHT_TYPE)in->getAttributeAsEnumeration("LightType", video::LightTypeNames);
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
const core::vector3df& position, video::SColorf color, f32 range); const core::vector3df& position, video::SColorf color, f32 range);
virtual ~CLightSceneNode(); virtual ~CLightSceneNode() { }
//! pre render event //! pre render event
virtual void OnRegisterSceneNode(); virtual void OnRegisterSceneNode();
...@@ -31,7 +31,10 @@ public: ...@@ -31,7 +31,10 @@ public:
virtual void render(); virtual void render();
//! set node light data from light info //! set node light data from light info
virtual void setLightData( const video::SLight& light); virtual void setLightData(const video::SLight& light);
//! \return Returns the light data.
virtual const video::SLight& getLightData() const;
//! \return Returns the light data. //! \return Returns the light data.
virtual video::SLight& getLightData(); virtual video::SLight& getLightData();
......
...@@ -1690,30 +1690,47 @@ void COpenGLDriver::addDynamicLight(const SLight& light) ...@@ -1690,30 +1690,47 @@ void COpenGLDriver::addDynamicLight(const SLight& light)
s32 lidx = GL_LIGHT0 + LastSetLight; s32 lidx = GL_LIGHT0 + LastSetLight;
GLfloat data[4]; GLfloat data[4];
if( light.Type == video::ELT_DIRECTIONAL ) switch (light.Type)
{ {
// set direction case video::ELT_SPOT:
data[0] = -light.Position.X; data[0] = light.Direction.X;
data[1] = -light.Position.Y; data[1] = light.Direction.Y;
data[2] = -light.Position.Z; data[2] = light.Direction.Z;
data[3] = 0.0f; data[3] = 0.0f;
glLightfv(lidx, GL_POSITION, data);
data[3] = 1.0f;
glLightfv(lidx, GL_SPOT_DIRECTION, data); glLightfv(lidx, GL_SPOT_DIRECTION, data);
glLightf(lidx, GL_SPOT_CUTOFF, 180.0f);
glLightf(lidx, GL_SPOT_EXPONENT, 0.0f);
}
else
{
// set position // set position
data[0] = light.Position.X; data[0] = light.Position.X;
data[1] = light.Position.Y; data[1] = light.Position.Y;
data[2] = light.Position.Z; data[2] = light.Position.Z;
data[3] = 1.0f; data[3] = 1.0f; // 1.0f for positional light
glLightfv(lidx, GL_POSITION, data); glLightfv(lidx, GL_POSITION, data);
glLightf(lidx, GL_SPOT_EXPONENT, light.Falloff);
glLightf(lidx, GL_SPOT_CUTOFF, light.OuterCone);
break;
case video::ELT_POINT:
// set position
data[0] = light.Position.X;
data[1] = light.Position.Y;
data[2] = light.Position.Z;
data[3] = 1.0f; // 1.0f for positional light
glLightfv(lidx, GL_POSITION, data);
glLightf(lidx, GL_SPOT_EXPONENT, 0.0f);
glLightf(lidx, GL_SPOT_CUTOFF, 180.0f);
break;
case video::ELT_DIRECTIONAL:
// set direction
data[0] = -light.Direction.X;
data[1] = -light.Direction.Y;
data[2] = -light.Direction.Z;
data[3] = 0.0f; // 0.0f for directional light
glLightfv(lidx, GL_POSITION, data);
glLightf(lidx, GL_SPOT_EXPONENT, 0.0f);
glLightf(lidx, GL_SPOT_CUTOFF, 180.0f);
break;
} }
// set diffuse color // set diffuse color
...@@ -2006,6 +2023,11 @@ void COpenGLDriver::setFog(SColor c, bool linearFog, f32 start, ...@@ -2006,6 +2023,11 @@ void COpenGLDriver::setFog(SColor c, bool linearFog, f32 start,
else else
glFogf(GL_FOG_DENSITY, density); glFogf(GL_FOG_DENSITY, density);
if (pixelFog)
glHint(GL_FOG_HINT, GL_NICEST);
else
glHint(GL_FOG_HINT, GL_FASTEST);
SColorf color(c); SColorf color(c);
GLfloat data[4] = {color.r, color.g, color.b, color.a}; GLfloat data[4] = {color.r, color.g, color.b, color.a};
glFogfv(GL_FOG_COLOR, data); glFogfv(GL_FOG_COLOR, data);
......
...@@ -361,12 +361,13 @@ void CShadowVolumeSceneNode::setMeshToRenderFrom(IMesh* mesh) ...@@ -361,12 +361,13 @@ void CShadowVolumeSceneNode::setMeshToRenderFrom(IMesh* mesh)
// create as much shadow volumes as there are lights but // create as much shadow volumes as there are lights but
// do not ignore the max light settings. // do not ignore the max light settings.
u32 lights = SceneManager->getVideoDriver()->getDynamicLightCount(); const u32 lights = SceneManager->getVideoDriver()->getDynamicLightCount();
core::matrix4 mat = Parent->getAbsoluteTransformation(); core::matrix4 mat = Parent->getAbsoluteTransformation();
core::vector3df parentpos = Parent->getAbsolutePosition(); const core::vector3df parentpos = Parent->getAbsolutePosition();
core::vector3df lpos; core::vector3df lpos;
mat.makeInverse(); mat.makeInverse();
// TODO: Only correct for point lights.
for (i=0; i<lights; ++i) for (i=0; i<lights; ++i)
{ {
const video::SLight& dl = SceneManager->getVideoDriver()->getDynamicLight(i); const video::SLight& dl = SceneManager->getVideoDriver()->getDynamicLight(i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment