My first asset I’ve ever created for the Unity Asset Store. It took a full 2 months to develop and contains everything you need for block-based lighting effects in a full 2D environment. Although the underlying Tilemap structure makes it 2D, it is still a plane and can of course be used for 3D games as well. I’m developing my own 2D survival game Evergreen and along the way I decided to grab my modular lighting system and turn it into an asset. This is the result.
UPDATE: Version 1.2 – Cycle of Life has been released!
This update’s main feature, and the most requested one, is a day / night cycle system. Performance control has been greatly improved, which also includes smooth light placement and smooth light / chunk removal. UI is less intrusive and in dark mode and in general the lighting is about 300% faster than before which makes this a pretty solid update. I also renamed the asset to Block Light 2D.
What is it?
Block Light 2D is a block-based multi-layered propagating light framework that penetrates the ground, using Unity’s Tilemap system.
[Core features]
– Ambient lighting and placable lighting, all customizable in color and strength;
– A complete day night cycle system with customizable colors, speed, interval, span and dawn focus point;
– A highly optimized algorithm ensuring incredibly fast light updates that aren’t directly bound to the number of active lights for every action. You can have hundreds of lights in view with only a fraction of the performance loss;
– A special performance control section that spreads asset script CPU execution over multiple frames, depending on a customizable max milliseconds slider. Game already performance heavy? Just set the limit to a few ms and you never have to worry about lag spikes from this asset. Guaranteed top performance on any machine or game with the right setting. Hooking up your own scripts to this system is also possible.
– A complete lighting user interface with settings like:
– – – – Toggle lighting on or off with the click of a button;
– – – – Toggle random light color for placed lights;
– – – – Light penetration adjustment for the front and back layer;
– – – – Back layer shading that controls the base shading factor for cave systems;
– – – – Day night cycle tweak options to fit any world.
The user interface also provides tools right out of the box like:
– – – – Placing blocks on any layer;
– – – – Removing blocks on any layer;
– – – – Placing lights throughout the world;
– – – – Removing lights;
– A guide explaining the asset in its entirety, including how to set it up in your game, F.A.Q. and more as well as fully documented code for each script.
Also included in this asset is Terrainify 2D, my free terrain generator combined with a robust chunk loading system. Check out its page for more information. Its guide is included in this asset as well.
Requirements
– At least Unity 2017.2 or later because of the integrated Tilemap system from Unity.
NOTE: Earlier versions than 2018.2.11 have not been tested as of now. 2019.1.x is compatible.
Future plans
– Utilize ECS, the C# Job system and the Burst compiler to optimize CPU times even more with multi-threading if possible;
– Multi-channel color blending with a single pass;
– [Finished] A day night cycle system;
– [Finished] Implement terrain generator and chunk loading
– [Finished] A thorough expansion of engine functions to make it easier to manipulate the asset;
History:
UPDATE: Version 1.1, updated details down below.