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

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

                lightsCollected.Add(light);
            }
        }
Esempio n. 2
0
 protected override void OnEntityAdding(Entity entity, LightComponent state)
 {
     base.OnEntityAdding(entity, state);
     lights.Add(state);
 }