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

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



On May 24, 2010, at 10:48 PM, Cedric Vivier 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.

What does { depth:24 } mean? Currently the value of depth is 'true' or 'false'. We may allow numeric values in the future, but for now you have no choice in the matter. If you turn on depth and turn off stencil, the implementation is free to allocate a 32 bit zbuffer. If, for another context, they turn on both depth and stencil, they can make the depth buffer 24 bits and the stencil 8. The author has no control over it. They are just assured the buffers will be at least as big as the spec says (16 bits for z and 8 bits for stencil).


-----
~Chris
cmarrin@apple.com





-----------------------------------------------------------
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: