Log in with 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

  1. Split all shadow-casting shapes into a list of line segments.
  2. For each line segment, generate a quad mesh.
  3. In a renderpass, render each quad mesh with a shader that displaces the outer edge away from the light source. These are all rendered to a screenspace RenderTexture. As this is done by the GPU, it's very fast.
  4. In a renderPass, multiply the current screen by the light texture. 

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, 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 ?

(1 edit)

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.