This might seem silly but here goes..
is there a way to set the default lighting for all objects
This is what im doing now..(taken after spacewars)
Matrix m_view = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
Matrix m_proj = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 20000.0f);
for (int i = 1; i < MAX_MODELS; i++)
{
foreach (ModelMesh mesh in Enemy
{
//This is where the mesh orientation is set, as well as our camera and projection
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
//effect.LightingEnabled = false;
effect.World = Enemy
effect.View = m_view;
effect.Projection = m_proj;
}
//Draw the mesh, will use the effects set above.
mesh.Draw();
}
}
When i do this my Frame rate takes a big hit... I narrowed the problem down to the line of code effect.EnableDefaultLighting();....... Its not so much the lighting, because if i shut the lighting off after this call i still get a crazy slow FPS. Is there anyway i can just EnableDefault lighting through out my game... so its not enableing it for every effect in every mesh of every model
Thanks,
-Wes