[Public WebGL] IMPORTANT: Your WebGL floating point texture usage needs to be fixed!!!!

Benoit Jacob [email protected]
Wed Jun 5 18:40:47 PDT 2013


Yup, I was misremembering. Thanks!

Side note: I couldn't find this information anywhere in the GL ES 2.0
spec or in the OpenGL ES or WebGL extension specs.

Side note 2: I also tried to find where in the GL ES 2.0 spec it is said
which are the default values for TEXTURE_MIN_FILTER and
TEXTURE_MAX_FILTER and couldn't find that information either. The State
Tables at the end of the spec say "see 3.7" but I couldn't find that
information there.

Benoit

On 13-06-05 06:41 PM, Gregg Tavares wrote:
> It's RGBA=(0,0,0,1)
>
> See OpenGL ES 2.0 spec 2.0.25 section 3.8.2
>
>
> On Wed, Jun 5, 2013 at 2:07 PM, Benoit Jacob <[email protected]
> <mailto:[email protected]>> wrote:
>
>
>     So, we are about to implement this now in Mozilla. Just a question: in
>     the current specification, when linear filtering is used without
>     OES_texture_float_linear enabled, should the outcome be RGBA=(0,0,0,0)
>     texel values as in the case of an incomplete texture?
>
>     Benoit
>
>     On 13-05-28 06:21 PM, Gregg Tavares wrote:
>     > There's was a bug in both Chrome and Firefox which is that the
>     > OES_texture_float extension should not have allowed linear
>     filtering.
>     > That bug has been fixed in Chrome Canary.
>     >
>     > To use floating point textures with linear filtering you must
>     get both
>     > the OES_texture_float and OES_texture_float_linear extensions.
>     >
>     > I suspect this will break the majority of WebGL apps that use
>     floating
>     > point textures. Fortunately there are not 'that' many and the
>     fix is easy.
>     >
>     > For most of the existing WebGL apps using floating point
>     textures you
>     > need to do this to get the behavior you were getting previously.
>     >
>     >    ext1 = gl.getExtension("OES_texture_float");
>     >    ext2 = gl.getExtension("OES_texture_float_linear");
>     >
>     > Otherwise if OES_texture_float_linear does not exist you can set
>     your
>     > filtering to NEAREST something like
>     >
>     >    ext1 = gl.getExtension("OES_texture_float");
>     >    if (!ext1) {
>     >       alert("no support for floating point textures");
>     >       return;
>     >    }
>     >    ext2 = gl.getExtension("OES_texture_float_linear");
>     >    float_filtering = ext2 ? gl.LINEAR : gl.NEAREST;
>     >
>     >    ... when using floating point textures
>     >
>     >    gl.texImage2D(,....., gl.FLOAT, ..);
>     >    gl.texParameter(...., gl.TEXTURE_MIN_FILTER, float_filtering);
>     >    gl.texParameter(...., gl.TEXTURE_MAG_FILTER, float_filtering);
>     >
>     >
>     > Note: While it's sad this fix broke some apps the apps were already
>     > broken as many mobile GPUs support OES_texture_float but not
>     > OES_texture_float_linear. This fix makes it possible for an app to
>     > tell if a device supports OES_texture_float_linear and take
>     > appropriate steps.
>     >
>     >
>
>
>     -----------------------------------------------------------
>     You are currently subscribed to [email protected]
>     <mailto:[email protected]>.
>     To unsubscribe, send an email to [email protected]
>     <mailto:[email protected]> with
>     the following command in the body of your email:
>     unsubscribe public_webgl
>     -----------------------------------------------------------
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20130605/4504edd9/attachment.html>


More information about the public_webgl mailing list