Re: [css-shaders] GLSL implementation defined limits

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