W3C home > Mailing lists > Public > public-svg-ig@w3.org > July to September 2008

FW: [svg-developers] shadow projections

From: Dailey, David P. <david.dailey@sru.edu>
Date: Fri, 26 Sep 2008 13:54:09 -0400
Message-ID: <1835D662B263BC4E864A7CFAB2FEEB3D0186E015@msfexch01.srunet.sruad.edu>
To: <public-svg-ig@w3.org>
I copy a small thread below from today's svg-developers.


I think one of the purposes of the SVG Interest Group
http://www.w3.org/Graphics/SVG/IG/  can be (perhaps) to catalog and help
prioritize some of these situations that the spec seems not yet to
allow. The SVG Working Group is starting to think about non-affine
transforms (like trapezoidal ones) and new types of filters as mentioned
in the enclosed. One of the Interest Group's responsibilities might be
able to serve as a staging area for such "tricky" problems. If better
solutions can be found then let's find them. If not, let's see if the
use cases justify the cost of expanding the spec (which as Robin Berjon
pointed out today is a lot more than just scoping out some new syntax).


I've been trying to keep a list of things at
http://srufaculty.sru.edu/david.dailey/svg/Spec.html (where the all
purpose <contour> <map> <superpath> and <doodle> are introduced), but it
seems like maybe the wiki would be a better place, so that new ones and
their discussion (like Bruce's and Robin's earlier today) could just be
linked to from a list. Maybe I'll get a chance to illustrate what I mean
on the wiki later this weekend. I think the wiki is probably better than
the community web site, since, in theory, the folks doing the adding
would also be doing some pruning.




From: svg-developers@yahoogroups.com
[mailto:svg-developers@yahoogroups.com] On Behalf Of Dailey, David P.
Sent: Friday, September 26, 2008 1:30 PM
To: svg-developers@yahoogroups.com
Subject: RE: [svg-developers] shadow projections


David [Leunen] wrote:

>I'm missing two filters in SVG. Or I don't know if they exist or not.

Filters are just complicated enough it's not always easy to tell. Based
on the questions you've asked, it sounds like you have a pretty good
understanding of what's there and what isn't. 

>The first one is a simple transform. I don't want to apply the
>directly to the svg element, but rather to an intermediate filter
>result. It is already possible for translations with feOffset, but not
>other kinds of transformations, afaik.
>I think it would be great to make shadow projections (*skew*) and
>(negative *scale*).

Interesting idea. This would not be hard to implement with script: grab
the thing from the DOM; clone it; remove it from its parent (to simulate
a z-order move to front), append the clone with a transform to the
parent, then reappend the original. Doing it through markup would be
handy, though feOffset tends to be so slow (and I'm not quite sure why)
(look at this attempt to move slices of an image without making copies
using feOffset
http://srufaculty.sru.edu/david.dailey/svg/later/offsets7.svg to see
slow) so feOffset with a transform would be really slow.

>There is a workaround using feDisplacementMap (see example below). But
>filter has some issues with performance, ease of use and I can't see
how to
>make the map dimension relative to the filtered object.

Your example didn't come through (yahoogroups doesn't allow attachments
I think), so you may have to put on a server somewhere and include a
link. The problem with feDisplacementMap that I can see is that while it
can be used to deform objects, the deformation is a bit unpredictable.

See attempt1

>The second feature I'm missing is a blur with a variable stdDeviation
>(depending on the pixel location).
>I know I can make the stdDeviation different for each axis, but it's
>what I want.
>I want the blur to be null at the bottom part, and increase
>toward the top of the object.
>This also would be very useful for shadow projections (of a vertical
>on a horizontal ground).

Agreed. This would be cool and agreed that it is not to be done quite
the way you're talking about. I've thought about it before and the best
approach I've thought of would involve something like this: create two
versions one more blurred and the other less, and then use a mask that
fades from one to the other from top to bottom. (with SMIL enabled
browser http://srufaculty.sru.edu/david.dailey/svg/newstuff/mask3.svg
does something like this but without the blurring)

>The only workaround I can think of would involve a displacement map
>would enlarge the bottom part (a trapezoidal-like transform), apply the
>effect, and then apply the inverted displacement map in order to have
>shape back in place.

Sorta like http://srufaculty.sru.edu/david.dailey/svg/distort.svg ?
That's going to be hard to control, and I'm not sure quite how you'd
invert the displacement map.... Maybe I'm confused about what you mean.


David [Dailey]

Received on Friday, 26 September 2008 17:55:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:28:23 UTC