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]