5

In a recent build of Samsung's OS (I'm testing with a Galaxy S6) Chrome disables WebGL. The reason for this is documented here. I'm running Chrome without the blacklist using this flag:

--ignore-gpu-blacklist

enter image description here

These are the errors that Three.js spits out at me. I'm curious to know if Three.js can successfully run/render if these OES extensions don't exist:

  • OES_texture_float
  • OES_texture_float_linear
  • OES_texture_half_float
  • OES_texture_half_float_linear
  • OES_texture_filter_anisotropic

If so, how would I go about altering Three.js so that this could work? If not, where can I read up further on these extensions so I can get a better understanding of how they work?

jonobr1
  • 1,013
  • 2
  • 11
  • 22

1 Answers1

5

All five of these extensions deal with textures in the following ways:

The first four extensions support floating-point textures, that is, textures whose components are floating-point values.

  • OES_texture_float means 32-bit floating point textures with nearest-neighbor filtering.
  • OES_texture_float_linear means 32-bit floating point textures with linear filtering.
  • OES_texture_half_float means 16-bit floating point textures with nearest-neighbor filtering.
  • OES_texture_half_float_linear means 16-bit floating point textures with linear filtering.

See texture_float, texture_float_linear, and ARB_texture_float (which OES_texture_float_linear is based on) in the OpenGL ES Registry.

Three.js checks for these extensions (and outputs error messages if necessary) in order to enable their functionality.


The last extension (called EXT_texture_filter_anisotropic) provides support for anisotropic filtering, which can provide better quality when filtering some kinds of textures.

Registry: https://www.khronos.org/registry/gles/extensions/EXT/texture_filter_anisotropic.txt

This page includes a visualization of this filtering.

Here too, Three.js checks for this extension to see if it can be used.


For all these extensions, it depends on your application whether it makes sense to "go about altering Three.js". For instance, does your application require floating-point textures for some of its effects? (You can check for that by checking if you use THREE.HalfFloatType or THREE.FloatType.)

Although Three.JS checks for these extensions, it doesn't inherently rely on these extensions in order to work, and only at least one example requires their use. Therefore, the issue is not so much to modify Three.js as it is to modify your application. Nonetheless, here, in WebGLExtensions.js, is where the warning is generated.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
  • Thanks, this is really helpful @Peter! So, I removed all the textures in my application and the `anisotropy` warning disappears. I'm not explicitly invoking `THREE.HalfFloatType` or `THREE.FloatType` and in Three.js it looks like the only objects that invoke their use are anisotropy and `THREE.Skeleton`. But, I still get the warnings that those extensions are not supported... Is there another way to check for their use? – jonobr1 Jul 14 '15 at 18:21
  • 1
    You may get the warnings for the first four extensions _as soon as_ you create a `THREE.WebGLRenderer` for the first time. You may get the warning for `EXT_texture_filter_anisotropic` the first time you set a texture parameter. You may check if you otherwise rely on any of these extensions by _temporarily_ deleting the lines that check for those extensions in your copy of THREE.js, running your application, and seeing if you get errors or undesired behavior. If there are none, the warnings for those five extensions are little to be concerned about. – Peter O. Jul 14 '15 at 21:52
  • 1
    Also, if the warnings still bother you nonetheless, you can raise an issue on the Three.js GitHub site, asking for a change in the code to better warn about these five extensions _as soon as the application relies on them_, rather than just the first time a `THREE.WebGLRenderer` is created, for example. – Peter O. Jul 14 '15 at 21:56
  • Ah, got it got it. Thanks this was super helpful! – jonobr1 Jul 15 '15 at 23:25