public void ActivateLight(Light light)
        {
            //TODO: Performance
            DXLight dxl = new DXLight();

            if (light is PointLight)
            {
                PointLight pointLight = light as PointLight;
                dxl.Type = SlimDX.Direct3D9.LightType.Point;
                dxl.Ambient = pointLight.Ambient;
                dxl.Diffuse = pointLight.Diffuse;
                dxl.Specular = pointLight.Specular;
                dxl.Position = pointLight.Position;
                dxl.Range = pointLight.Power;
                //TODO
                dxl.Attenuation0 = 0.0001f;
                dxl.Attenuation1 = 0.0001f;
                dxl.Attenuation2 = 0.0001f;
            }

            GraphicsDirect3D9.Device.SetLight(light.Index, dxl);
            GraphicsDirect3D9.Device.EnableLight(light.Index, true);
        }
Exemplo n.º 2
0
        public void ActivateLight(Light light)
        {
            //TODO: Performance
            DXLight dxl = new DXLight();

            if (light is PointLight)
            {
                PointLight pointLight = light as PointLight;
                dxl.Type     = SlimDX.Direct3D9.LightType.Point;
                dxl.Ambient  = pointLight.Ambient;
                dxl.Diffuse  = pointLight.Diffuse;
                dxl.Specular = pointLight.Specular;
                dxl.Position = pointLight.Position;
                dxl.Range    = pointLight.Power;
                //TODO
                dxl.Attenuation0 = 0.0001f;
                dxl.Attenuation1 = 0.0001f;
                dxl.Attenuation2 = 0.0001f;
            }

            GraphicsDirect3D9.Device.SetLight(light.Index, dxl);
            GraphicsDirect3D9.Device.EnableLight(light.Index, true);
        }