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

Re: Merging CSS Shaders proposal into Filter Effects

From: Vincent Hardy <vhardy@adobe.com>
Date: Sun, 6 Nov 2011 15:45:08 -0800
To: Johannes Behr <johannes.behr@igd.fraunhofer.de>, "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <CADC5B21.201E6%vhardy@adobe.com>
Hi Johnannes,

Thanks for the additional explanations. I am leaning towards having the spec just say that vertex shaders should preserve interactivity since we have precedents and techniques that show it can be done. This is the requirement, and the 'how' is an implementation issue, which does not have to be in the spec. We need to demonstrate implementability, and your reference shows it has been done before.


From: Johannes Behr <johannes.behr@igd.fraunhofer.de<mailto:johannes.behr@igd.fraunhofer.de>>
Date: Fri, 4 Nov 2011 09:45:06 -0700
To: Adobe Systems <vhardy@adobe.com<mailto:vhardy@adobe.com>>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com<mailto:jackalmage@gmail.com>>, Robert O'Callahan <robert@ocallahan.org<mailto:robert@ocallahan.org>>, Dean Jackson <dino@apple.com<mailto:dino@apple.com>>, Chris Lilley <chris@w3.org<mailto:chris@w3.org>>, Patrick Dengler <patd@microsoft.com<mailto:patd@microsoft.com>>, Dirk Schulze <vbs85@gmx.de<mailto:vbs85@gmx.de>>, "public-fx@w3.org<mailto:public-fx@w3.org>" <public-fx@w3.org<mailto:public-fx@w3.org>>
Subject: Re: Merging CSS Shaders proposal into Filter Effects


From: "Tab Atkins Jr." <jackalmage@gmail.com<mailto:jackalmage@gmail.com>>
Date: Fri, 4 Nov 2011 00:43:39 -0700
To: Robert O'Callahan <robert@ocallahan.org<mailto:robert@ocallahan.org>>
Cc: Dean Jackson <dino@apple.com<mailto:dino@apple.com>>, Chris Lilley <chris@w3.org<mailto:chris@w3.org>>, Adobe Systems <vhardy@adobe.com<mailto:vhardy@adobe.com>>, Patrick Dengler <patd@microsoft.com<mailto:patd@microsoft.com>>, Dirk Schulze <vbs85@gmx.de<mailto:vbs85@gmx.de>>, "public-fx@w3.org<mailto:public-fx@w3.org>" <public-fx@w3.org<mailto:public-fx@w3.org>>
Subject: Re: Merging CSS Shaders proposal into Filter Effects
On Fri, Nov 4, 2011 at 12:27 AM, Robert O'Callahan <robert@ocallahan.org<mailto:robert@ocallahan.org>> wrote:
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.
That's not so crazy.  I think Greg Tavares had the same idea.
This was discussed during yesterday's FX F2F and Johannes Behr talked about approaches with picking shaders that use the R/G/B channels to store picking information. He showed a demo during the break. From your and Johannes' description, it seems to be similar. I have cced Johannes so that he can comment. I have an action to further research this and add a proposal to the spec.

Right. But you do not even need a 256x256 texture. You can write the interpolated texture-coordinate as color in your fragment shader.
The method is revert do "Picking Buffer Test" and very common in 3D graphics environments.


It's usually used to determine the 3D coordinate and/or ID of the picked 3D object but in this case it would be the original UV coordinates.
There are different ways to implement this. With a second path or a single path with multiple render targets (even with FBOs).
There are various optimizations (e.g. with stencil buffers) but the basic idea is the same. Render the full object with the extra information and look ab the 2D pixel position afterwards.

best regards


Dr. Johannes Behr
Abteilungsleiter Visual Computing System Technologies
Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-510  |  Fax +49 6151 155-196
johannes.behr@igd.fraunhofer.de<mailto:johannes.behr@igd.fraunhofer.de>  |  www.igd.fraunhofer.de
Received on Sunday, 6 November 2011 23:46:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:39 UTC