Today's post is about lighting. I know I went over lighting before, however my implementation sucked.
Basically what I was doing before was that when a sectors light level(0-255) changed, I looped through every vertex in the sector and changed its colour value.
My new method is to enable D3D lighting and when each subsector's render function is called, change the RenderState.AmbientColor property.
Device.RenderState.AmbientColor = Drawing.Color.FromArgb( 255, Sector.LightLevel, Sector.LightLevel, Sector.LightLevel ).ToArgb();
One call instead of what could have been hundreds, much better.