DAE's Lighting System with Optimised Real-Time Shadows and Animated Lights

DaedraTalos

Evil Plugin Overlord
Veteran
Joined
Jul 8, 2016
Messages
168
Reaction score
164
First Language
English
Primarily Uses
RMMZ
14nIM46XMS.gifRaG0yLpHmU.gifeJDOU3AKhe.gifrQolCzQ6pk.gif
What's been added since the plugin was first released:
- Spritesheet animations for lighting
- Custom animation settings for lighting (animated lights without using images)
- Light culling and various optimisations
- PNG-based lights + settings-based lights
- Custom directional offsets (for flashlights and such)
- Light rotations and angle wideness

(The help file has more detailed instructions, make sure to check it out!)







1631701139395.png
1631701146488.png1631701152502.png1631701161238.png1631701169034.png



Download DEMO (non-commercial) project: https://daedrakyne.itch.io/daes-lighting-system
Buy PRO version (commercial-version):
  1. If you want to support me, send me £10 ($13.85) via PayPal and send me a PM with a screenshot to confirm your payment, and once the payment is confirmed, I'll send you the plugin and add your forums account to the list of paying users (to send you future updates of the plugin): https://paypal.me/SModley?locale.x=en_GB

  2. Otherwise, buy the £15 ($20.78) version on itch.io (you instantly get access to the plugin and future updates, but I only get 50~65% of your payment): https://daedrakyne.itch.io/daes-lighting-system

Hey there! :kaojoy:
I've been working for a while now on a new lighting plugin for both MV and MZ.
My reason for starting down this road was due to this post from about a month ago:

I've researched the most efficient 2D-RTS lighting systems, and have decided to base mine on a pure-hardware (GPU) implementation.
In its current state, without culling (meaning that for now every light in the scene is being rendered/updated, regardless of whether it's even on the screen or not), the game can handle ~650 lights (with shadows) in one scene without its fps dropping.

If you could try it out, and leave your thoughts down in a reply below, I would really appreciate it! My goal is to make a plugin that is more diverse than khas' while still being as optimized as possible.

Plugin commands (MV) (no need for MZ plugin command instructions):
  • dae_light setambientlight r g b
    • Sets the current ambient light to the specified color.
    • r, g and b are numbers from 0 to 255 that represent an rgb color.
    • Example: dae_light setambientlight 0 20 0
  • THE REST OF THE PLUGIN COMMANDS ARE THE SAME AS THE EVENT COMMENTS, BUT WITHOUT "[" AND "]"


Event comments (run whenever event page changes):
  • [dae_light addlight uniqueID type]
    • Adds a new light and sets its position to that of the event. Light will follow the event wherever it goes
    • uniqueID can be either "null" or any word (letters, numbers and underscore). If set to null, the light will not be stored as a unique light (meaning that it won't be designable by other commands / comments)
    • type must be one of the light types from the plugin parameters. For example, "halogen". New light types can be created in the plugin parameters.
    • Example: [dae_light addlight halo2 halogen]
  • [dae_light setoffset uniqueID offsetX offsetY]
    • Sets a manual offset for the designed light, if it exists.
    • offsetX and offsetY are numbers.
    • Example: [dae_light setoffset halo2 0 24]
  • [dae_light setcolor uniqueID R G B]
    • Sets the color of the light
    • R, G and B are numbers between 0 and 255
    • Example: [dae_light setcolor uniqueID 255 0 255] (pink)
  • [dae_light setrotation uniqueID rotation]
    • Sets the rotation of the light
    • Rotation is an angle between 0 and 360
  • [dae_light setangle uniqueID angle]
    • Sets the angle wideness of the light.
    • Angle is between 0 (no light) and 360 (full light)
    • Example: an angle of 180 will create a semi-circle light
  • [dae_light setintensity uniqueID intensity]
    • Sets the intensity of the light.
    • Intensity is between 0 (no light) to 200 (bright light).
    • For some reason, the MZ plugin can't handle a single intense light, but works fine with multiple lights added together. Until this is fixed, you can overlap multiple lights together to create a bright light.
  • [dae_light setrotation/f uniqueID rotation]
    • Sets how much the light rotates every frame.
    • Rotation is any number, negative or positive, and with decimals allowed.
Map notes:
  • <dae_light off> -- Disables lighting for that map
  • <dae_light shadowpicture picture_name> -- Uses the given picture as a shadow map for that map. The picture must be in the "img/shadows/" folder.
    • Example: <dae_light shadowpicture shopping_map_shadow>
    • Shadow maps can be easily created by saving a picture of a map (right-click on map -> save), going to a picture editor (I used piskelapp.com), and drawing black in a new layer wherever you want shadows to be.

There is no current customization for RegionIDs (it is easily implementable, just wanted to get the demo out first), but you can currently use the regionID 17 to create a blue light, and regionIDs 4, 6 and 7 to create shadows. (4: full block shadow, 6: left wall shadow, 7: right wall shadow)


Changelog:


  • v 1.5
    1. Added support for light spritesheet animations.
    2. Added support for light custom animations (settings-based)
    3. Implemented customisability for Region Shadows and Region Lights.
    4. Implemented various performance optimisations.
    5. Implemented basic light-culling.
  • v1.3
    1. Added support for custom images for lights! (like khas' plugin)
    2. Added customisability support for custom-image lights (resizing, color tinting, + everything else)
    3. Added direction-based custom offset option for lights, useful when making flashlights
    4. Added plugin command for ambient light
  • v1.2
    1. In-game light modifications (color, intensity, rotation, angle, rotation/f, offset)
    2. Automatic offset change depending on the rotation of the light
    3. Automatic light rotations (rotating lights!!), with customizable speeds
    4. Light angle/wideness customization: you can now create flashlights, and beams!

Current goals for the next version:
- light / shadow heights
- event shadows (you heard that right! events will be able to have shadows too)
 
Last edited:

DaedraTalos

Evil Plugin Overlord
Veteran
Joined
Jul 8, 2016
Messages
168
Reaction score
164
First Language
English
Primarily Uses
RMMZ
Sounds sick!
Thanks! I'm currently working on making a quick new map for MZ (due to legal reasons) and making nice scenes to take screenshots of to show in the top post ^^ If you want to demo what you've been able to make with the plugin, feel free to post it here! :kaojoy:
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
753
Reaction score
263
First Language
Vietnamese
Primarily Uses
RMMV
This is cool as a new lighting plugin replacing Khas'. I really wanna use it, but I have finished more than 50% of my games, and replacing Khas' plugin is truly a pain now.
 

DaedraTalos

Evil Plugin Overlord
Veteran
Joined
Jul 8, 2016
Messages
168
Reaction score
164
First Language
English
Primarily Uses
RMMZ
This is cool as a new lighting plugin replacing Khas'. I really wanna use it, but I have finished more than 50% of my games, and replacing Khas' plugin is truly a pain now.
I've tried to make this plugin as compatible with Khas' as possible, so migrating from one to the other shouldn't be too much of a pain ^^ Let me know if you'd like the plugin to be able to read khas commands directly, though, to simplify the migration
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
753
Reaction score
263
First Language
Vietnamese
Primarily Uses
RMMV
I've tried to make this plugin as compatible with Khas' as possible, so migrating from one to the other shouldn't be too much of a pain ^^ Let me know if you'd like the plugin to be able to read khas commands directly, though, to simplify the migration
Wow! Truly music to my ears. I have hundreds of lighting events from Khas' plugin in my game, so if you can make this plugin to be able to read Khas' commands directly, it will be perfect for those who are in the same trouble as me.
 

DaedraTalos

Evil Plugin Overlord
Veteran
Joined
Jul 8, 2016
Messages
168
Reaction score
164
First Language
English
Primarily Uses
RMMZ
MV: (Fixed a bug where the lights would "pop into existence" when first rendered on screen)
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,255
Reaction score
2,874
First Language
Dutch
Primarily Uses
RMMV
if you have the nice feature of the wall (1 block (not 1 tile height/1tile top)
than i would be super happy :) I love the sensore part too however that is done.

you do a really awersome job for the community, the best I have ever seen
in my opinion, than ocram -> shora I believe -> cummunity lightning which have
side walls/corner light as well.

but this is truly amazing :)
 

Dusttt

Villager
Member
Joined
Nov 12, 2017
Messages
24
Reaction score
79
First Language
French
Primarily Uses
RMMV
Really nice work !
Can't wait the version with event shadow.

To be honest i'm waiting this function before buying it.
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
465
Reaction score
125
First Language
English
Primarily Uses
RMMZ
What is "event shadow"?
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,255
Reaction score
2,874
First Language
Dutch
Primarily Uses
RMMV
@Dark_Ansem my guess like NPC have shadows when walking in the light,
while ghost events does not.

I think you get more control how event shadows work and when not.
or events that can have shadows or should have by default, you can
give some more :)

it's a guess, but that is what I think what he ment with "Event Shadow".
 

ephesus

Veteran
Veteran
Joined
Dec 10, 2015
Messages
165
Reaction score
89
Primarily Uses
Is this plugin still being supported?
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,255
Reaction score
2,874
First Language
Dutch
Primarily Uses
RMMV
it is still supported, he is just currently busy in RL, so give him time :)
when he continues would be unknown depending if he work or to school etc.
 

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
249
Reaction score
96
First Language
Italian
Primarily Uses
RMMV
Hello! This plugin has a big issue. I tested the demo and I got this error when saving the game:


 

Rinjuli

Villager
Member
Joined
Mar 15, 2019
Messages
10
Reaction score
2
First Language
Indonesian
Primarily Uses
RMMV
Hello, is there any plugin command flashlight for player (like "PlayerLantern flashlight" khas plugin)? All I see is for the event. I'm checking demo project but it just long script that i don't know how to implement to my project. Putting the script to my project and i got this error.adsa.png
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
465
Reaction score
125
First Language
English
Primarily Uses
RMMZ
I'll never understand how this Plugin has dynamic shadows but Visustella hasn't.
 

Latest Threads

Latest Profile Posts

Calibrating the timing of dialogue is deffo my new least favorite thing.
I died aged 27 to cancer. Then I was reborn in a South-American state. I retained all memories and skill and had a goal from my previous life I needed to finish, but now I was just a 1-year-old girl capable of only smiling at others.

Dreams like this one make me glad I'm able to wake up from them at will.
Found a critical bug the other day with the time system that would have caused none of the NPCs to spawn. Since I use dev mode to test time-based stuff, I didn't catch this for way too long!
Last missing piece, a plugin to let weapons and armor be used as multiple equip types
What if the Actor Battlers disappeared when your selecting enemies...
ndyhHXV.gif

Forum statistics

Threads
129,969
Messages
1,206,594
Members
171,186
Latest member
Bluswat
Top