Re: [css4-images] custom blending effects

On 27/11/2011, at 3:58 PM, Charles Pritchard wrote:

> I've proposed JS shaders in addition to glsl.

There are a few things against JS shaders:

- The GLSL horse has already bolted. It's part of WebGL.
- There is a huge amount of content already out there using GLSL (both on and off the Web).
- Many many tools support it.
- There are many things we'd need to add to the JS language in order to map to GPU types.
- Unless people completely understand the conversion to the native shading language, then debugging and performance tuning could be difficult.

There are a few things for it too:

- It might be more acceptable to those platforms (platform?) that don't have GLSL by default, assuming JSS can be easily converted to GLSL or HLSL.
- It's JavaScript, which many developers will be familiar with (on the downside, it won't necessarily look like regular JS).
- It might better enable a software rendering mode

I think we need a concrete proposal otherwise this is stuck in the "wouldn't it be nice" box.

Dean

> On Nov 26, 2011, at 8:42 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> 
>> Hi Dean,
>> 
>> What if we extend the SVG compositing spec to include CSS and provide the ability to do a custom blend using glsl? It seems pretty straightforward to come up with a syntax since the notation is basic.
>> If we combine this with transitions, it seems that this would be powerful and also enable your use case.
>> 
>> We do need to come up with a way to calculate background in a HTML context both for compositing and filters...
>> 
>> Rik
>> 
>> 
>> On Thu, Nov 24, 2011 at 3:13 PM, Dean Jackson <dino@apple.com> wrote:
>> This is a completely half-baked proposal, but I figured it was ok to embarrass myself on this list rather than forget about the idea. This is definitely not a proposal from Apple as a whole. Just one fool mumbling in public.
>> 
>> The cross-fade() function is going to be extremely useful. However, cross-fading is one of many blending operations [*]. IIRC SMPTE (and the larger SMIL spec) list a set of predefined functions like wipe, iris, dissolve, etc.
>> 
>> [*] The terminology is going to be confusing. Typically such operations are called 'transitions' but that term already has a meaning in CSS. Obviously 'blending' here isn't the same operation as you typically associate with compositing and Photoshop-like effects. We're just talking about moving from one image to another image over time.
>> 
>> I wonder if we should add another operation to CSS 4 images that allows more blending operations. My suggestion would be to allow a CSS Shader with three hard-coded inputs (like cross-fade): image1, image2 and amount of blend (0 - 1). This would allow for some pretty snazzy effects.
>> 
>> cross-fade would just be the special/common case of e.g. image-blend(crossfade, image1, image2, 0.4)
>> 
>> [1] Here's the SMIL set of predefined transitions: http://www.w3.org/TR/2005/REC-SMIL2-20050107/smil-transitions.html
>> 
>> Dean
>> 
>> 
>> 

Received on Sunday, 27 November 2011 18:56:48 UTC