[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Few questions/comments about context creation attributes

On Mon, May 24, 2010 at 10:48 PM, Cedric Vivier <cedricv@neonux.com> wrote:
> On Tue, May 25, 2010 at 06:59, Kenneth Russell <kbr@google.com> wrote:
>> We discussed this at length earlier in the working group. The basic
>> question is whether getContext("webgl") should ever return null if the
>> hardware is capable of running WebGL. The earlier consensus was that
>> it is easier to program to a "closest fit" context selection model
>> than a "minimum requirements" model.
> Good to know, nothing in the specification does imply this model
> afaik, quite the opposite if you consider repeated usage of "at
> least".
> Does it means that for instance when "stencil:true" is passed but
> stencil is not supported with the given canvas resolution on a given
> hardware, WebGL will give back a context without stencil buffer since
> it would be the closest fit it could find ? Could get funny results if
> the application relies on it.
> Or "closest fit" works only with regards to precision in each buffer ?
> In this case, right now with the booleans attribute WebGL indeed
> defines a minimum fit model ("at least").
> That said I understand the intention and agree that the closest-fit
> model sounds more web-ish :)
> I think should add a bit about this in the spec so that
> implementations (and implementations to-be) do not assume otherwise.
> I think replacing some of the boolean context attributes with integers
> as suggested would be the perfect opportunity to do that, what do you
> think ?
> It works beautifully with the "closest fit" model as well, allowing
> WebGL to return the closest fit to what is requested/preferred by the
> developer as soon as better support lands in implementations [1].
> Also since we use a "closest fit" model adding minX/maxX for every
> attribute later on does make even less sense imho (one would assume
> that if the closest fit is below minimum or above maximum a context
> cannot be created and null should be returned - breaking the whole
> purpose of the closest-fit model).
> Regards,
> [1] : e.g {depth:24} does not return null not supported, just returns
> the "closest-fit" 16-bit depth buffer if not supported, and returns a
> 24-bit on supporting implementations where it makes sense.

The working group discussed at length whether to make the context
creation attributes numeric values, and the decision was to leave them
as boolean flags for the WebGL 1.0 release. The feeling was that this
will provide enough control while still retaining simplicity, and
could be evolved in a forward direction (allowing numeric values to be
supplied in a future version of the specification).

You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: