Drop Shadow filter only working for filled objects

Bug #1743768 reported by Patrick Storz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Low
Unassigned

Bug Description

Just tried to figure out for quite a while why I could not make Filters -> Drop Shadow work with an "Inner" shadow type.

Turns out the filter requires the object to be filled to produce the proper drop shadow, which is an easy fix if one knows the cause but very confusing otherwise.

I assume adding a note to the extension dialog might be sufficient to avoid other users this frustration in future.

Revision history for this message
Hachmann (marenhachmann) wrote :

I've asked Lazur to take a look, maybe he can even find a solution that makes the filter behave more like you expected it to work. Btw. this also affects the other 'inner' filter.

Revision history for this message
Patrick Storz (ede123) wrote :

Thanks!
It even affects the "outer" options (to a lesser extent). As in that case a shadow is always rendered it's harder to spot, though.

Revision history for this message
Pétery Tamás (lazur) wrote :

Hi. Not sure what should be expected from the "drop shadow..." filter. They generate a straightforward filter chain in the filter editor. Only thing that's odd about it is the panel claiming a px blur value while it uses a gaussian blur filter primitive which is percentage based.

(The convolve matrix filter primitive could produce a px based blurring but that's limited to a 5 px value by the gui and the px size is always what's rendered on screen -so it'd produce the same blurring radius at every zooming level with no scaling. Quite pointless for a dropshadow effect as per se.)

Or how applying the filter to one object, selecting another object and applying it with a different setting stitches the two filters together... that's definitely a bug.

What the filter does:
Set up a flood colour, composite it with the shape, blur and offset it,
then in another composite filter primitive it is composited with the original unfiltered shape.

That is in another words, the original shape is used to mask a shadow object -but instead of using luminance, the masked object is visible where the original object is opaque-,
the "masked" shadow is blurred,translated on screen relative to the original object, and
put behind it.
If the original shape was an opaque rectangle, the shadow would be a simple duplicant with a solid fill.

That's how the dropshadow "outer" option work.

The "inner" shadow option composites the dropshadow with the original shape in an "in" mode.
if there is no fill in the filtered object, nothing casts a shadow, nor there is any pixels they could be composited with.
In general, filters are added on the rendering level only. It cannot take an unfilled vector shape and say, "fill that up" with a flood colour.
Can only fill areas based on already existing pixels or areas defined in an odd parametric way in the filter chain.

Thinking it over I'd guess that's what you expect? It'd be a very nice feature if the compositing worked the other way around but there are hard-wired limitations of the svg format not even inkscape can cope with.

Revision history for this message
Patrick Storz (ede123) wrote :

Thanks for investigating this!

I guess this brings us back to "adding a note to the extension dialog might be sufficient".

Regarding the "outer" case I agree that it would actually be wrong to assume a filling of the shape - obviously also a line can have a drop shadow.

The thing that makes especially the "inner" case very unintuitive is that the filter is applied to the whole object (including stroke) making the word "inner" kind of ambiguous and the result is not what one would expect naively from what other software provides when it uses the term "drop shadow".

Revision history for this message
Pétery Tamás (lazur) wrote :

From the "inner" shadow I'd expect an effect simulating that the filtered object was carved or pressed below the screen surface and the shadows wouldn't go over its boundaries however I'm not sure about the original intention.
For that purpose it doesn't work either.

It'd need a flood fill composited with the original shape with "out" mode, then blurred, offsetted and put atop the original shape and cut to its boundaries.
Then it'd be more realistic -though the filtered area size may still need adjustments.

Revision history for this message
Hachmann (marenhachmann) wrote :

Lazur, I'm having a hard time imagining this all without pictures. For the effect you describe in the first paragraph of comment #5 - would it look 'realistic' in that use case, for an object like a flat ring?

What would change if the 'more realistic' version were used?

Revision history for this message
Hachmann (marenhachmann) wrote :

(Forgot to say: Thank you for coming over and helping us out here!)

Revision history for this message
Pétery Tamás (lazur) wrote :

Made a simple screen capture playing with the dropshadow filter:
https://youtu.be/17uQOd-TOrc

Seems the "inner" shadow works as I expected, somehow remembered a different result from previous testing.

Revision history for this message
Hachmann (marenhachmann) wrote :

Lazur, that video is 22 minutes long - is there a specific part of it that helps with this bug report, or were you really just playing around?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.