Lights sources and animation
#2
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.

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();
}
  


Messages In This Thread
Lights sources and animation - by ViSoR - 11-23-2011, 12:07 AM
RE: Lights sources and animation - by ViSoR - 11-23-2011, 11:22 PM
RE: Lights sources and animation - by abenedik - 11-24-2011, 04:47 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)