public static void enableExtension() {
    if (!WebGL10.isContextCompatible())
      throw new IllegalStateException(
          "You must have a WebGL context >= 1.0 to enable this extension.");

    if (!isSupported())
      throw new RuntimeException(
          "This browser does not support the EXT_shader_texture_lod extension.");

    if (!isExtensionEnabled()) nEnableExtension();
  }
  public static boolean isSupported() {
    if (!WebGL10.isSupported()) return false;

    if (!WebGL10.isContextCompatible())
      throw new IllegalStateException(
          "You must have a WebGL context >= 1.0 to check if extension is supported.");

    for (String supportedExtension : WebGL10.glGetSupportedExtensions()) {
      switch (supportedExtension) {
        case "EXT_shader_texture_lod":
        case "O_EXT_shader_texture_lod":
        case "IE_EXT_shader_texture_lod":
        case "MOZ_EXT_shader_texture_lod":
        case "WEBKIT_EXT_shader_texture_lod":
          return true;
      }
    }

    return false;
  }