Commit Graph

4 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 9b4edc8fb0 filter-sdf-effects: Improve shadow rendering
This works around the incorrect shadow on the edge of the Signed Distance Field, but it does not get rid of it completely. Due to linear sampling it will still show at some point so a different solution has to be found in the future.
2019-01-31 02:25:09 +01:00
Michael Fabian 'Xaymar' Dirks ecd17cff6c filter-sdf-effects: Fix colored shadows changing image
Colored shadows previously had an effect on the image color, but this is incorrect if the image is fully opaque. This fixes it by using premultiplied alpha mixing instead.
2019-01-30 03:37:46 +01:00
Michael Fabian 'Xaymar' Dirks 7cf3e17b9b filter-sdf-effects: Fix black border and add inverse gradient shadow
Sources were rendering with a black border around them if they had a soft fade, which is due to how the shadow calculated the image sample. With the new shader code this is now fixed and the source looks like it should be. Additionally this removes the bug where enabling any shadow would cause only the texels to draw that were above the threshold.

Additionally this adds support for inverse gradients (min > max) and negative gradients for outer shadows instead of only positive gradients. This technically allows for cleaner shadows.
2019-01-30 02:38:34 +01:00
Michael Fabian 'Xaymar' Dirks 0c92f3dbf5 filter-shadow-sdf: Inner/Outer shadow based on signed distance fields
Adds Inner/Outer Shadows for dynamic sources based on signed distance field generation. This is fast, but does add a bit of latency when it comes to updates - which means that moving objects will leave a trail before the generator has a chance to update.

Fixes #3
2018-11-08 13:52:43 +01:00