2D Lighting system
Drag and drop objects & lights with the mouse.
For optimal performance, the downloaded version is recommended.
This scene demonstrates two plugins I've been working on.
The first is the lighting. All light and shadows seen in this demo are the result of my code, running as a ScriptableRenderPass inside URP.
The second is the pixel-width lines.
Although Unity has the capability to render line meshes, it lacks the ability to import them. To get around this, I wrote a plugin that extends the .blend import process, allowing Unity to import line meshes, and calculate colliders and fill meshes from them.
If you're interested in source code, please let me know.
Download
Download
Windows Build 22 MB
Install instructions
Download and unzip.
Do not move the .exe out of the folder.
Comments
Log in with itch.io to leave a comment.
Hi, I don't know which technique you used but - is there any way you could implement smooth (distance based blur) shadows? or even with constant antialiasing? That's one of the biggest limitations of URP 2D lighting so far :/
The technique I used here is
In my current version of this. I do a few more things to to get soft shadows (generating triangles at the ends of line segments for the soft penumbra part of the shadow), so soft shadows are definitely possible with this method.
As all the lights are drawn to a single screenspace texture before rendering, it would be possible to run AA on this, but it might require implementing it from scratch/reverse engineering one of Unity's render passes, which wouldn't be a minor task.
Would be interested to check this out, have ODIN if it's still needed.
Sure, Drop me an email at lordmlekk@gmail.com, and I can send you the current version.
Be warned though, it's still experimental and in development, so I wouldn't really recommend it to non-coders at the moment.
I'm interested for source code. It looks much better than Unity 2D light. Care to share ?
Hi. Unfortunately, the this plugin was designed using the ODIN inspector (an asset that extends the unity inspector and serializer. I'd highly recommend it, it's one of those "must have" assets), which I don't have the right to share the source code to. If you have that asset I'd be happy to share my code, or if you wait a bit they're developing a redistributable for situations like this, though there's no ETA on that.