Super Fast Soft Shadow system in progress for Unity

June 8th, 2015| Posted by Andy Korth
Categories: Uncategorized | Tags:

Hi everyone- We’ve started a 2D soft shadow system and we wanted to share some screenshots and in-progress videos of how it’s going. The goals are:

Moving and flickering! Click to embiggen

* Speed on mobile platforms
* High number of colored lights and shadowed objects
* Flexibility in light size and softness of shadows

Super Fast Soft Shadows uses a unique shader based algorithm: Shadow projection occurs inside the vertex shader, not on the CPU.

Shadow mask generation occurs in a single pass – it doesn’t use expensive image filters or pixel shaders to soften the shadows. This means it runs great on mobile!

Physically realistic penumbra, umbra, and antumbra rendering is based on configurable light sizes. This produces accurate rendering when the light source is larger than the objects casting the shadows.

 

Penumbras and Antumbras

It can produce nice, accurate penumbras, and even antumbras when the light source is bigger than the object casting the shadow. This is because we are calculating the actual occlusion percentages when casting the shadows instead of applying some sort of blur or other image based effect. Blurs are incredibly bandwidth intensive, and this is especially a problem on mobile. Even though the occlusion we calculate is per pixel, it’s a pretty short fragment shader and most of the math is done in the vertex shader. You are really just paying for the fillrate to blend the visible parts of the shadow masks and lights.

 

Multiple colors! Click to embiggen

Comments are closed.