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.

 

David

 

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
transform
>directly to the svg element, but rather to an intermediate filter
primitive
>result. It is already possible for translations with feOffset, but not
for
>other kinds of transformations, afaik.
>I think it would be great to make shadow projections (*skew*) and
reflection
>(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
this
>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
<http://srufaculty.sru.edu/david.dailey/svg/later/displace2.svg> 
attempt2
<http://srufaculty.sru.edu/david.dailey/svg/later/displace4.svg> 
attempt3
<http://srufaculty.sru.edu/david.dailey/svg/later/displace7.svg> 

>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
not
>what I want.
>I want the blur to be null at the bottom part, and increase
progressively
>toward the top of the object.
>This also would be very useful for shadow projections (of a vertical
object
>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
that
>would enlarge the bottom part (a trapezoidal-like transform), apply the
blur
>effect, and then apply the inverted displacement map in order to have
the
>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.

Cheers

David [Dailey]




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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 14 April 2009 16:29:30 GMT