Re: [css-shaders] Do we need shader blending?

From: Chris Marrin <cmarrin@apple.com<mailto:cmarrin@apple.com>>
Date: Thu, 20 Oct 2011 06:30:22 -0700
To: "public-fx@w3.org<mailto:public-fx@w3.org>" <public-fx@w3.org<mailto:public-fx@w3.org>>
Subject: [css-shaders] Do we need shader blending?


The issue of turning on blending modes for a CSS shader came up recently (http://www.w3.org/Graphics/fx/wiki/Custom_Filters#Issue_06), which got me thinking about it. It's important to note that when we talk about blending of the shader, we're not talking about when the filtered element is composited with the page. I thought that was handled by another proposal, although I can't find it at the moment. At any rate, that issue SHOULD be handled as a separate issue.

Yes. There is an SVG compositing specification which the FX task force decided to turn into a CSS compositing specification during the last F2F meeting in Seattle:

http://www.w3.org/TR/2009/WD-SVGCompositing-20090430/


And we need to realize what a CSS shader does. It takes an input texture, which is the output from the last filter stage, and uses that to generate output pixels for the next filter stage. And without using blending modes we can write an alpha value with the output pixel. The only thing turning on blending would buy us is combining the pixel generated by the fragment shader with the pixel already in the output buffer. Conceptually, the output buffer of the shader starts as transparent black, so I don't think there's ever a need to control the blending modes.

Does that sounds right?

Yes it does. Doing something about blending to the final surface in the FilterEffects or the custom shader spec. interferes with the compositing spec.

Cheers,
Vincent

Received on Thursday, 20 October 2011 16:19:49 UTC