How do I create a circle/cone of light that shines outwards onto objects/walls in the direction I'm currently facing? It must be able to be switched on and off!
Thanks!
Flashlight help!
I was able to add directX spotlights into the engine pretty easily a while ago, but they only worked with the standard per vertex lighting so it didn't look that great unless the surface it was pointed at had a lot of vertices.
Here's a topic that uses a shader to create a nice looking spotlight effect with per pixel lighting: http://irrlicht.sourceforge.net/phpBB2/ ... pixel+spot
Here's a topic that uses a shader to create a nice looking spotlight effect with per pixel lighting: http://irrlicht.sourceforge.net/phpBB2/ ... pixel+spot
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
Yeah I was able to add it by adding a few variables to SLight (Theta and Phi for the spotlight cone, as well as Falloff, and a seperate vector3df for direction of the spotlight since the spotlight needs both a positiona and a direction and I added ELT_SPOT to the light type enumerated list) after that I just modified the addDynamicLight() function in the d3d8 and d3d9 drivers to have D3DLIGHT_SPOT as an option. As far as I can tell this works pretty good (no per pixel lighting though).
I'm curious as to what that design flaw was, or was this only in an older version of irrlicht?
I'm curious as to what that design flaw was, or was this only in an older version of irrlicht?
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
No, the problem is that SLight has a position and the LightSceneNode also has one. In most times the two are the same, but it's easily done that you overwrite some value by changing and updating the structures the wrong way. So I'm going to remove the position from SLight and will use that from the scene node only. However, there are some problems with passing the correct position down to the drivers and shaders.