W3C home > Mailing lists > Public > public-fx@w3.org > October to December 2011

Re: Merging CSS Shaders proposal into Filter Effects

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 4 Nov 2011 20:27:55 +1300
Message-ID: <CAOp6jLb2tuENAxi4CT-4Z0UF-2qjiAOvPtFjKjWbQX69KfG8bQ@mail.gmail.com>
To: Dean Jackson <dino@apple.com>
Cc: Chris Lilley <chris@w3.org>, "Tab Atkins Jr." <jackalmage@gmail.com>, Vincent Hardy <vhardy@adobe.com>, Patrick Dengler <patd@microsoft.com>, Dirk Schulze <vbs85@gmx.de>, "public-fx@w3.org" <public-fx@w3.org>
On Wed, Nov 2, 2011 at 10:26 AM, Dean Jackson <dino@apple.com> wrote:

> Either way, I don't think CSS Shaders is adding anything new here beyond
> what's already possible.
>

Geometry transformations are possible in SVG filters with feOffset and
feDisplacementMap, but I think the CSS Shader examples are a lot more
focused on large-scale geometry transformation than any SVG filter example
I've seen (apart from one crazy Mario Kart hack).

I think it would make sense to tell authors to put their geometry
transformations in the vertex shader and invert that for event coordinate
transformation, and ignore any transformations induced by the fragment
shader, like we do for SVG filters today --- if we can find a reasonable
way to implement it.

One crazy idea I just had to implement event coordinate transformation:
create a 256x256 texture, set each pixel's R value to the X coordinate and
G value to the Y coordinate, apply the vertex shader with an identity
fragment shader, and save the result. To transform an event coordinate,
extract from the result the color value at the pixel you care about, and
recover the original X and Y values from the R and G channels.

Rob
-- 
"If we claim to be without sin, we deceive ourselves and the truth is not
in us. If we confess our sins, he is faithful and just and will forgive us
our sins and purify us from all unrighteousness. If we claim we have not
sinned, we make him out to be a liar and his word is not in us." [1 John
1:8-10]
Received on Friday, 4 November 2011 07:29:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 4 November 2011 07:29:02 GMT