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

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



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 <bjacob@mozilla.com> 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 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
-----------------------------------------------------------