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

[Public WebGL] Non-binding context creation attributes, specifically 'stencil'



This demo which works 'correctly' in Chrome does not work in Firefox:
http://www.playtankworld.com/demo/stencil_shadows

This is because the author does not request a stencil buffer at context creation. In the absence of a selection, the context creation hint 'stencil' defaults to false. However, 'antialias', 'depth', and 'stencil' are non-binding hints. That is, a compliant implementation can ignore them.

While this is necessary for when such buffers are not available, it is also allowable to always supply such buffers, even when they are (implicitly or explicitly) not requested.  Firefox never supplies such buffers when the relevant context creation attribute is false, which is the default for stencil buffers. Chrome appears to supply stencil buffers in the absence of any request. (possibly in spite of a negative request, but I have not checked) I have not yet checked other browsers.

This implementation-defined behavior causes the above demo to render as intended in Chrome, but fails to do so in Firefox. If we were to have a strict or adverse reference renderer, this demo would also fail to consistently render as intended there. Since the two implementations are (in as far as this demo is concerned) spec-compliant, I believe this is a spec issue.

I move that we require any (implicit or explicit) negative requests for 'antialias', 'depth', and 'stencil' to guarantee they will not be supplied with that respective buffer type, similar to 'alpha'. Because 'stencil' defaults to false, this means that in the absence of a positive request for a stencil buffer, the context will not receive one.

-Jeff

Firefox bugs filed because of this are:
https://bugzilla.mozilla.org/show_bug.cgi?id=648883
https://bugzilla.mozilla.org/show_bug.cgi?id=745880

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