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

Re: [Public WebGL] Centroid sampling makes conformance tests fail?




On 20/06/2012 04:35, Nicolas Capens wrote:

Hi all,

...

Using centroid sampling appears to be entirely within spec. The OpenGL ES 2.0 specification section 4.3.5 on varyings states that: "If single-sampling, the interpolated value is for the fragment center. If multi-sampling, the interpolated value can be anywhere within the pixel, including the fragment center or one of the fragment samples." Also, the OES_standard_derivatives extension suggests, but does not require, that "Functions should be evaluated within the interior of a primitive (interpolated, not extrapolated)."

... Hence I believe that the majority of the WebGL conformance tests should not be using anti-aliasing, unless that's explicitly part of the test.
I agree.
It seems rather unfortunate to me that WebGL defaults to enabling anti-aliasing, given how much it can make the result differ between fully compliant implementations.
It's for better visual quality, I suppose. Stage3D does the same. That's merely a point of interest. Stage3D post-dates us; I am not suggesting we copied them.
Also, while it's possible to prevent ANGLE from using centroid sampling, it's not an easy thing to do, and there are actually cases where centroid sampling is valuable (which is why it exists in the first place).
Centroid vs. non-centroid sampling has been a choice shaders can make in desktop GL for a couple of versions now. One can therefore expect it to eventually show up in a distant future version of WebGL. That suggests it should not be arbitrarily used now. In what cases, given the WebGL and OpenGL ES spec's today is it valuable for ANGLE to use it?

Regards

    -Mark