Problem with SpotLights [SOLVED]

MouseTaylor

24-05-2012 21:04:15

I've been playing with the lights a bit and came to a weird conclusion;

when I test the Spotlight on a "in code" generated plane:


Plane plane = new Plane(Mogre.Vector3.UNIT_Y, 0);
MeshPtr wallMesh = MeshManager.Singleton.CreatePlane("Floor", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, plane, 1000, 1000, 100, 100, true, 1, 5, 5, Mogre.Vector3.UNIT_Z);

Entity floorplane = GameEngine.TheSceneManager.CreateEntity("Floor", "Floor");
floorplane.SetMaterialName("02-Default");
floorplane.CastShadows = false;
SceneNode floorNode = GameEngine.TheSceneManager.RootSceneNode.CreateChildSceneNode("floorNode");
floorNode.AttachObject(floorplane);


I got the following result:




Which is exactly what I want

But when I make a simple plane in 3DS Max, export it using OgreMax and load it using the following code:


Entity floor = GameEngine.TheSceneManager.CreateEntity("floor", "floor.mesh");
SceneNode floorNode = GameEngine.TheSceneManager.RootSceneNode.CreateChildSceneNode("floorNode");
floor.CastShadows = false;
floorNode.AttachObject(floor);

mesh uses the same Material

I get this:



I don't understand, what am I forgetting / doing wrong?

Thnx

T.

tafkag

25-05-2012 11:07:25

My first guess would be, that your modelled plane consists of only the 4 corner vertices and so, the per-vertex-lighting spotlight doesn't reach any vertex. The code-plane consists of 100 segments in each direction, so there probably are plenty of vertices for the spotlight.

MouseTaylor

25-05-2012 18:37:59

Tafkag, thnx man that did the trick, I subdevided my plane and the magic worked!


Result ( added a falloff cone for better result :) )



T.