W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2012

Re: [Public WebGL] [filters] Shading language recommendation

From: Chris Marrin <cmarrin@apple.com>
Date: Thu, 23 Aug 2012 08:39:11 -0700
Cc: steve@sjbaker.org, "Tab Atkins Jr." <jackalmage@gmail.com>, public-fx@w3.org
Message-id: <F6F811CD-1988-4F71-B740-FB02FB528FDA@apple.com>
To: Sylvain Galineau <sylvaing@microsoft.com>

On Aug 23, 2012, at 7:41 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Thu, Aug 23, 2012 at 6:49 AM, Sylvain Galineau
> <sylvaing@microsoft.com> wrote:
>>> We need a single shader language standard because sooner or later, other
>>> web-based technologies such as SVG and <canvas> will require it.
>> Ah, I see. 'We' need a single language, GL SL is a single language, therefore
>> we need GL SL.
>> I think we're done with this part of the thread.
> Yes, please ignore the guy trolling.
> However, I don't think you've adequately answered *why* you think GLSL
> shouldn't be required.
> You've said that we should allow for expansion, so that future shader
> languages can be supported.  Sure, that's reasonable.  But that has
> nothing to do with what languages we require to be supported in the
> beginning.  What is *wrong* with requiring GLSL as a supported
> language, but allowing extensions such that you can expose additional
> languages?
> Your last substantive email was in response to Dirk, where you
> repeatedly stressed the importance of developer choice in the matter,
> but never actually argued for why "1 required option, + additional
> choices" was bad.  Can you elaborate?  More importantly, can you
> explain why that is worse for developers than "you have to write all
> your shaders twice - once for IE and once for everyone else"?

I agree with both points. Please ignore the trolls (always good advice :-) but let's go deeper into why you feel GLSL should not be required.

Let's take the case of JavaScript. Its support is technically not required in the HTML Script element. But imagine what would have happened if there were no scripting language authors could have counted on. If some browsers supported only VBScript, others supported only JavaScript and still others decided to go with TCL, I believe the history of the web would have been much messier. A few authors might have rewritten their scripts for multiple platforms. But most would simply have written for the currently dominant platform and others would be left out. Someone might have even come up with some ad hoc language which would have been translated on the server for the desired platform, no doubt with inconsistent results. The web might be a very different place today, with many authors opting to avoid using scripting altogether because of the mess.

As it turns out, that was when the web was young and JavaScript quickly became the de facto standard. A spec was written, Open Source implementations were created and there was an amazing amount of interoperability at the time.

But the web is more mature today. A language agnostic approach to shading languages would be disastrous (in my opinion) for the adoption of this feature. This is especially true since this feature is not as ubiquitous as a scripting language. It's use will always be reserved for the most advanced web pages. My fear is that, without a required shading language, the feature will be ignored by authors because they can't get coverage on a high enough percentage of browsers.

Here's another example. I've been involved with 3D web standards for over 18 years. VRML was a failure partly because it was not useful in enough situations, but also because it was not available on a large enough number of platforms. X3D is languishing for the same reasons. But we've been working on WebGL for just a few years, and it's really getting some great traction. That is due in part to the fact that it has a small surface area and is therefore easy to get multiple compliant implementations on a variety of platforms. But it's also due to the fact that it has a single well-defined scripting language. And WebGL is in its infancy. Apple has not even done a public release yet, and you're just now starting to see it appear on mobile devices. 

Many are holding their breath in hopes that Microsoft will add their support to WebGL, to make it truly ubiquitous. And you are unfortunately seeing some blowback from the trolls on this list because of that tension.

CSS Shaders can be a great addition to the set of tools available to authors, but only if it can be used in a sufficiently large percentage of browsers to make it worthwhile to add to a webpage. And if the browser support gets fragmented because of lack of a required shading language  then I fear the feature will go unused and we will miss out on some cool new effects.

~Chris Marrin

Received on Thursday, 23 August 2012 15:39:39 UTC

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