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

Re: [css-shaders] GLSL implementation defined limits

From: Chris Marrin <cmarrin@apple.com>
Date: Thu, 10 Nov 2011 20:24:40 -0800
Message-id: <64186680-2199-4FEE-86D4-F49266095795@apple.com>
Cc: "public-fx@w3.org" <public-fx@w3.org>
To: "Gregg Tavares (wrk)" <gman@google.com>

Sent from my iPad

On Nov 10, 2011, at 4:20 PM, "Gregg Tavares (wrk)" <gman@google.com> wrote:

> Up until this point, AFAIK, CSS you either have a feature (like 3D css) or you don't but if you do have the feature then for the most part there aren't too many situations where you'll run into serious limits.
> In other words, while you have to worry that whether or not gradients exist, if they do exist you can generally count on them working for all reasonable inputs.
> But that's not true with CSS shaders.  It will be very easy to create CSS shaders that work on some hardware but not on others either by making them too long or by exceeding other limits of the user's GPU.
> WebGL leaves this up to the dev to deal with but it's a programatic API. You can check that it failed at runtime.
> CSS is generally declare and forget.
> Should it be that if any CSS shader on a page does not compile that all CSS shaders on the page should be ignored? That would at least mean that you don't have some elements displaced and others not. You either get everything you intended or you get your fallback, no CSSshader layout.
> Of course that's problematic since CSS shaders can be changed and/or applied on the fly
> Maybe specifying some maximum limits or min spec hardware or something...?

CSS generally deals with this sort of thing by having fallbacks. So for transitions for instance, if you don't support them the property still changes. It just changes instantly rather than with an animation. So the worst thing that happens if the shader fails is that you still see the element, it just doesn't have the desired effect. In many cases that's not too bad. 

I agree that this case is different than most. With 3D transforms there's a media query you can use so you can provide a completely different style sheet if you don't support them. But here some shaders may succeed and some may fail and you may not know until well after load time (in the case of deferred loading of a style sheet).

It would be nice if we could have fallback style that could be used on a case by case basis. So you could provide a still image of the effect when you can't show it live, or something.  But I'm not sure how to do that in CSS. 

Received on Friday, 11 November 2011 04:25:20 UTC

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