Ejemplo n.º 1
0
        public override void Draw(RenderContext context)
        {
            // 1) Clear the cache of current lights (without destroying collections but keeping previously allocated ones)
            lightsCollected.Clear();

            var colorSpace = context.GraphicsDevice.ColorSpace;

            // 2) Prepare lights to be dispatched to the correct light group
            for (int i = 0; i < lights.Count; i++)
            {
                var light = lights.Items[i];

                if (!light.Update(colorSpace))
                {
                    continue;
                }

                lightsCollected.Add(light);
            }
        }
Ejemplo n.º 2
0
 protected override void OnEntityComponentAdding(Entity entity, LightComponent component, LightComponent state)
 {
     lights.Add(state);
 }
Ejemplo n.º 3
0
 protected override void OnEntityAdding(Entity entity, LightComponent state)
 {
     base.OnEntityAdding(entity, state);
     lights.Add(state);
 }