The spiritual successor to the Shadow Volumes Toolkit has now been released (2019-09-4): the Sharp Shadows Toolkit!
NO LONGER RELEVANT REALLY OLD POST AND POLL:
The Shadow Volumes Toolkit adds dynamic, pixel-perfect shadows to your projects. Drag and drop the bundled scripts onto the game objects of a scene, specify light/shadow properties and see the results in real-time. The toolkit supports all three Unity light types and any closed mesh can act as a shadow caster.
Works with Unity Free, Pro and Mobile.
Version 3.2 of the toolkit is now available on the asset store!
They look pretty good - I’m wondering now what advantages Unity shadows have over these? I’ve always wanted to have sharper shadows over distances ie. from trees on a landscape, but the shadow cascades just fall apart - could this implementation manage that?
Could there be an option to use depth fail as its quite cheap to patent, ie a toggle var so we can optionally apply for a patent for it - say on ios if need be?
Hey, another suggestion. I don’t know if this would be working, because i didn’t have a deeper look at this topic. Would it be possible to add a blur pass to the shadows, so your not limited to hard stencil shadows?
Sure, if it is possible on the webplayer. I get about 1000 fps on my MacBook Pro but the scene is quite simple.
Unity Pro lighting/shadows are (for obvious reasons) better integrated into the Unity engine and editor.
In my package you need to drag&drop a “Shadow Volume” prefab into the scene and onto the game objects you want to act as shadow casters, instead of just toggling a checkbox like in Unity Pro.
EDIT: The following paragraph is no longer true with the latest version of the toolkit. The toolkit has transformed a lot since these posts were written so check out the website for up to date information. Thanks!
Multiple simultaneous shadows per game object (from 2 different shadow-enabled lights) will work, but may not produce realistic results.
The shadows are applied by multiplying the scene with a “shadow strength” value which may produce unrealistic (for the lack of a better word) but still good looking shadows when there is ambient light in the scene or other light sources acting on the objects. Basically, the surfaces facing away from the light will be darker than the ambient term because of the shadows, ideally they would only be lit by the ambient term.
I believe this would be possible in Unity Pro by rendering the shadows into a RenderTexture and then using a smart blur shader to smooth the shadows before applying it to the scene. It could definitely prove a challenge to get it working though, especially while still supporting sharp shadows on Unity Free. The inherent limitations of the package (only sharp shadows/not as well integrated as Unity Pro shadows) is why I’ve decided on the low price point
I don’t know. I would like to avoid the algorithm altogether because there could be problems with me selling a product that “could potentially” be used to violate their patent. I believe that the toolkit is fast enough even when not using the depth-fail technique but it might become a bottle neck on mobile devices as you say. I will look into it when/if I get it running on mobile devices
As I wrote in the original post I would be happy if Unity/someone who knows could share how the alpha channel is handled on mobile devices and if it is possible to specify the framebuffer format.
So I guess they turned up to Siggraph, presented their paper and finished by saying “…but we just patented it so you can’t use it! Later assholes!”, at which point they jumped in a Ferrari and did donuts in their booth before speeding off.
Actually john carmack discovered it at the same time, and his version is known as carmack’s reverse. However carmack would be mortified if he was asked to patent something, so he never did (why would he? he gives his engines away free after a few years). The technique is very simple. It is not even mathy, and there is no doubt many people would have come to the same conclusion since at that point in history, everyone started working on faster stencil shadows.
It’s just very sad that they’d patent it then threaten to sue john even though he thought it up himself. They got an agreement where doom3 had to prioritise creative labs hardware. Sickens me.