1
SFML projects / Re: Let There Be Light 2
« on: January 28, 2017, 06:43:57 pm »
Uploaded it here: https://github.com/Ung0d/light_ungod/tree/master
However, its fully integrated in my engine (uses my quad-tree, depends on my signal system to emit signals when a light of an entity is changed, depends on my logger ect...) so this is not intended to compile in any way. I dont want to make my whole engine open source, hope you understand
I merged the things together I liked most of the different reimplementations of LTBL2 posted in this thread and added the stuff I usually have in systems in my engine (component-support, signals ect). I biggest changes I made are:
1) I introduced LightAffectors. Thats basically a std::function-wrapper that refers to a specific PointLight. The affector code is called every frame. Maybe its note noticeable in the gif, but you can realize light-flickering and other neat stuff this way. See LightSystem::update and LightAffector class
2) In (I think) all other versions of ltbl, a Light and a LightCollider were rendered (and all heavy calculations were computed) even if their bounding boxes did not collide and thus the light was not affected by the collider at all. I changed that behavior. Now the LightSystem checks for collision of the bounding boxes (which is cheap in compare) and light-colliders that do not collide with a light are ignored. See LightSystem::renderLight
However, its fully integrated in my engine (uses my quad-tree, depends on my signal system to emit signals when a light of an entity is changed, depends on my logger ect...) so this is not intended to compile in any way. I dont want to make my whole engine open source, hope you understand
I merged the things together I liked most of the different reimplementations of LTBL2 posted in this thread and added the stuff I usually have in systems in my engine (component-support, signals ect). I biggest changes I made are:
1) I introduced LightAffectors. Thats basically a std::function-wrapper that refers to a specific PointLight. The affector code is called every frame. Maybe its note noticeable in the gif, but you can realize light-flickering and other neat stuff this way. See LightSystem::update and LightAffector class
2) In (I think) all other versions of ltbl, a Light and a LightCollider were rendered (and all heavy calculations were computed) even if their bounding boxes did not collide and thus the light was not affected by the collider at all. I changed that behavior. Now the LightSystem checks for collision of the bounding boxes (which is cheap in compare) and light-colliders that do not collide with a light are ignored. See LightSystem::renderLight