11-23-2011, 11:22 PM
I have found workaround for this issue. Maybe it is not very good solution from the performance side, but on my dev and test configurations it works fine.
Main idea - collect lights settings after scene loading and restore it on each animation step.
Main idea - collect lights settings after scene loading and restore it on each animation step.
Code:
private Dictionary<Light, Color> _lights;
private void ReadSceneLightsColors()
{
_lights = new Dictionary<Light, Color>();
foreach (var light in _mainReader3ds.Lights)
{
_lights[light] = light.Color;
}
}
private void RestoreLights()
{
_mainReader3ds.BeginInit();
foreach (var light in _mainReader3ds.Lights)
{
light.Color = _lights[light];
}
_mainReader3ds.EndInit();
}
private void ViewOnRendering(object sender, EventArgs e)
{
_mainReader3ds.Animator.DoAnimate();
RestoreLights();
}
