Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTX2 integration -- Dropping support for KTX #9040

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
39 changes: 39 additions & 0 deletions Apps/SampleData/Cesium3DTiles/Tilesets/KTX2Tileset/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"asset": {
"version": "1.0"
},
"geometricError": 70,
"root": {
"transform": [
-0.8608332815512961,
-0.026091425783012157,
-0.5082177671768633,
0,
0.324224005982592,
-0.7978680937788927,
-0.5082177671768631,
0,
-0.39223061496806577,
-0.6022671686471426,
0.6952908760019272,
0,
-2506152.030937531,
-3848177.6543499078,
4412811.205275625,
1
],
"refine": "REPLACE",
"boundingVolume": {
"sphere": [
0,
0,
0,
100
]
},
"geometricError": 0,
"content": {
"uri": "Balloon.b3dm"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions Apps/Sandcastle/gallery/3D Models.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
);
},
},
{
text: "KTX2 Compressed Balloon",
onselect: function () {
createModel(
"../../SampleData/models/CesiumBalloonKTX2/CesiumBalloonKTX2.glb",
1000.0
);
},
},
];

Sandcastle.addToolbarMenu(options);
Expand Down
5 changes: 3 additions & 2 deletions Apps/Sandcastle/gallery/Image-Based Lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
}

var environmentMapURL =
"https://cesium.com/assets/kiara_6_afternoon_2k_ibl.ktx";
"../../SampleData/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx2";
var modelURL = "../../SampleData/models/Pawns/Pawns.glb";

// This environment map was processed using Google's Filament project. To process your own:
// 1 - Download the Filament release (https://github.com/google/filament/releases).
// 2 - Run `cmgen --type=ktx --deploy=/path/to/output /path/to/image.hdr`. Other formats are also supported. Run `cmgen --help` for all options.
// 3 - Take the generated coefficients and the KTX file and load them in CesiumJS as shown below.
// 3 - Take the generated coefficients and the KTX file and convert them using the ktx2ktx2 converter.
// 4 - Converter can be found here: https://github.com/KhronosGroup/KTX-Software/tree/master/tools/ktx2ktx2

Copy link
Contributor

@OmarShehata OmarShehata Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these instructions out of date/not working?

One problem we had when initially creating this Sandcastle is it was completely opaque what all these coefficients meant, or how to get your own. The user was never supposed to do this process manually. The glTF IBL extension just wasn't ready at the time.

But now it is: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_lights_image_based#ext_lights_image_based.

This example can be greatly simplified into essentially one line if we just add support for that extension. I would suggest we do that (not necessarily in this PR, open an issue for it?), and/or just remove this example because it isn't very useful to Cesium users as-is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Google's Filament hasn't been updated to support KTX2. I had to rebuild this cubemap by using this website, which gave six PNG images, which I then had adjust the opacity of and then convert to KTX2 using the command line tool from this repo.

We could always open up an issue to build a tool that automates this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One limitation of using EXT_lights_image_based is that it needs to be added to the glTF's individually whereas Cesium users might want to set an environment map for the entire scene.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It's critical for users to be able to select their own HDR, IBL environments. Can't expect ordinary models to bundle them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would most users know how to/want to manually specify the 9 coefficients as shown here? That was the part I was thinking we could omit from this sandcastle, and fallback to the procedural.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you fall back to procedural, the diffuse lighting on the model won't match the specular lighting environment, which is not what a user who cares about lighting environments is going to want to see. That said, I'm no fan of manually specifying spherical harmonics in code, that seems ridiculous and error-prone. But is the alternative to force all users to always accept a default procedural diffuse lighting environment?

By comparison, BabylonJS stores pre-filtered lighting environments in .env files of their own design, which users can create in their Sandbox (instructions). The .env file contains both diffuse and specular lighting pre-filtered, making it ready to render models with. I don't know if the format is standard or open, but I suppose we could ask. For users this is very easy, just load the env and assign it to the scene, and all your models will have the correct lighting and reflections of the environment.

In ThreeJS, they can now load *.hdr files directly. But these need some pre-filtering at load time, and they have a class called PMREMGenerator that will do exactly this. This costs some load-time performance, but offers users the convenience of directly using the most common HDR environment format found online.

I like the KTX file, but it looks like the file is only storing the pre-filtered specular lighting environment, and dumping out the diffuse as a bunch of SH coefficients for users to deal with separately. Unless maybe KTX2 has some way to include the diffuse environment as well? Ideally there should be a standard environment format that includes both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been working on the VSCode glTF preview, trying to get nice IBLs in all the preview windows, and it would be nice to include Cesium in this too.

In this commit I hacked up a little sh.txt file reader, which is the text file that cmgen writes out when it processed an IBL into a KTX. It loads the Spherical Harmonics and builds the array of Cartesians for them. Not sure if this will actually get published, but it seems to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watching a Virtual SIGGRAPH presentation on Filament (Moving Mobile Graphics, ~2:28:00). Romain says they're not using spherical harmonics at all anymore. Instead, they stop the specular IBL mipmaps at 16x16 smallest size with roughness == 1.0 at that size, and they re-use that particular mip level as their diffuse IBL.

I think Cesium should do that too, and ditch the SH coefficients.

var L00 = new Cesium.Cartesian3(
0.170455150831422,
Expand Down
9 changes: 1 addition & 8 deletions Apps/Sandcastle/gallery/Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,7 @@
function applyCompressedTextureMaterial(primitive, scene) {
Sandcastle.declare(applyCompressedTextureMaterial); // For highlighting in Sandcastle.

var compressedImageUrl;
if (scene.getCompressedTextureFormatSupported("s3tc")) {
compressedImageUrl = "../images/LogoDXT1.ktx";
} else if (scene.getCompressedTextureFormatSupported("etc1")) {
compressedImageUrl = "../images/LogoETC1.ktx";
} else if (scene.getCompressedTextureFormatSupported("pvrtc")) {
compressedImageUrl = "../images/LogoPVR.ktx";
}
var compressedImageUrl = "../images/Logo.ktx2";

primitive.appearance.material = new Cesium.Material({
fabric: {
Expand Down
Binary file added Apps/Sandcastle/images/Logo.ktx2
Binary file not shown.
Binary file removed Apps/Sandcastle/images/LogoDXT1.ktx
Binary file not shown.
Binary file removed Apps/Sandcastle/images/LogoETC1.ktx
Binary file not shown.
Binary file removed Apps/Sandcastle/images/LogoPVR.ktx
Binary file not shown.
72 changes: 70 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,83 @@
# Change Log

### 1.71.0 - 2020-07-01
### 1.72 - 2020-08-03

##### Breaking Changes :mega:

- CesiumJS no longer ships with a default Mapbox access token and Mapbox imagery layers have been removed from the `BaseLayerPicker` defaults. If you are using `MapboxImageryProvider` or `MapboxStyleImageryProvider`, use `options.accessToken` when initializing the imagery provider.

- CesiumJS no longer supports KTX and Crunch textures, use the [`ktx2ktx2`](https://github.com/KhronosGroup/KTX-Software) converter tool to update existing KTX files. [#9040](https://github.com/CesiumGS/cesium/issues/9040)

##### Additions :tada:

- CesiumJS now supports KTX2 textures compressed using Basis compression. UASTC textures not yet supported. [#9040](https://github.com/CesiumGS/cesium/issues/9040)

##### Deprecated :hourglass_flowing_sand:

- `MapboxApi.defaultAccessToken` was deprecated and will be removed in CesiumJS 1.73. Pass your access token directly to the MapboxImageryProvider or MapboxStyleImageryProvider constructors.
- `BingMapxApi` was deprecated and will be removed in CesiumJS 1.73. Pass your access key directly to the BingMapsImageryProvider or BingMapsGeocoderService constructors.

##### Fixes :wrench:

- Fixed `Color.fromCssColorString` when color string contains spaces. [#9015](https://github.com/CesiumGS/cesium/issues/9015)
- Fixed 3D Tileset replacement refinement when leaf is empty. [#8996](https://github.com/CesiumGS/cesium/pull/8996)
- Fixed a bug in the assessment of terrain tile visibility [#9033](https://github.com/CesiumGS/cesium/issues/9033)
- Fixed vertical polylines with `arcType: ArcType.RHUMB`, including lines drawn via GeoJSON. [#9028](https://github.com/CesiumGS/cesium/pull/9028)
- Fixed wall rendering when underground [#9041](https://github.com/CesiumGS/cesium/pull/9041)
- Fixed issue where a side of the wall was missing if the first position and the last position were equal [#9044](https://github.com/CesiumGS/cesium/pull/9044)
- Fixed `translucencyByDistance` for label outline color [#9003](https://github.com/CesiumGS/cesium/pull/9003)
- Fixed return value for `SampledPositionProperty.removeSample` [#9017](https://github.com/CesiumGS/cesium/pull/9017)
- Fixed issue where wall doesn't have correct texture coordinates when there are duplicate positions input [#9042](https://github.com/CesiumGS/cesium/issues/9042)

### 1.71 - 2020-07-01

##### Breaking Changes :mega:

- Updated `WallGeometry` to respect the order of positions passed in, instead of making the positions respect a counter clockwise winding order. This will only affect the look of walls with an image material. If this changed the way your wall is drawing, reverse the order of the positions. [#8955](https://github.com/CesiumGS/cesium/pull/8955/)

##### Additions :tada:

- Added `backFaceCulling` property to `Cesium3DTileset` and `Model` to support viewing the underside or interior of a tileset or model. [#8981](https://github.com/CesiumGS/cesium/pull/8981)
- Added `Ellipsoid.surfaceArea` for computing the approximate surface area of a rectangle on the surface of an ellipsoid. [#8986](https://github.com/CesiumGS/cesium/pull/8986)
- Added support for PolylineVolume in CZML. [#8841](https://github.com/CesiumGS/cesium/pull/8841)
- Added `Color.toCssHexString` for getting the CSS hex string equivalent for a color. [#8987](https://github.com/CesiumGS/cesium/pull/8987)

##### Fixes :wrench:

- Fixed issue where tileset was not playing glTF animations. [#8962](https://github.com/CesiumGS/cesium/issues/8962)
- Fixed a divide-by-zero bug in `Ellipsoid.geodeticSurfaceNormal` when given the origin as input. `undefined` is returned instead. [#8986](https://github.com/CesiumGS/cesium/pull/8986)
- Fixed error with `WallGeometry` when there were adjacent positions with very close values. [#8952](https://github.com/CesiumGS/cesium/pull/8952)
- Fixed artifact for skinned model when log depth is enabled. [#6447](https://github.com/CesiumGS/cesium/issues/6447)
- Fixed a bug where certain rhumb arc polylines would lead to a crash. [#8787](https://github.com/CesiumGS/cesium/pull/8787)
- Fixed handling of Label's backgroundColor and backgroundPadding option [#8949](https://github.com/CesiumGS/cesium/pull/8949)
- Fixed several bugs when rendering CesiumJS in a WebGL 2 context. [#797](https://github.com/CesiumGS/cesium/issues/797)
- Fixed a bug where switching from perspective to orthographic caused triangles to overlap each other incorrectly. [#8346](https://github.com/CesiumGS/cesium/issues/8346)
- Fixed a bug where switching to orthographic camera on the first frame caused the zoom level to be incorrect. [#8853](https://github.com/CesiumGS/cesium/pull/8853)
- Fixed `scene.pickFromRay` intersection inaccuracies. [#8439](https://github.com/CesiumGS/cesium/issues/8439)
- Fixed a bug where a null or undefined name property passed to the `Entity` constructor would throw an exception.[#8832](https://github.com/CesiumGS/cesium/pull/8832)
- Fixed JSDoc and TypeScript type definitions for `ScreenSpaceEventHandler.getInputAction` which listed incorrect return type. [#9002](https://github.com/CesiumGS/cesium/pull/9002)
- Improved the style of the error panel. [#8739](https://github.com/CesiumGS/cesium/issues/8739)
- Fixed animation widget SVG icons not appearing in iOS 13.5.1. [#8993](https://github.com/CesiumGS/cesium/pull/8993)

### 1.70.1 - 2020-06-10

##### Additions :tada:

- Add a `toString` method to the `Resource` class in case an instance gets logged as a string. [#8722](https://github.com/CesiumGS/cesium/issues/8722)
- Exposed `Transforms.rotationMatrixFromPositionVelocity` method from Cesium's private API. [#8927](https://github.com/CesiumGS/cesium/issues/8927)

##### Fixes :wrench:

- Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893)
- Fixed JSDoc and TypeScript type definitions for all `ImageryProvider` types, which were missing `defaultNightAlpha` and `defaultDayAlpha` properties. [#8908](https://github.com/CesiumGS/cesium/pull/8908)
- Fixed JSDoc and TypeScript for `MaterialProperty`, which were missing the ability to take primitive types in their constructor. [#8904](https://github.com/CesiumGS/cesium/pull/8904)
- Fixed JSDoc and TypeScript type definitions to allow the creation of `GeometryInstance` instances using `XXXGeometry` classes. [#8941](https://github.com/CesiumGS/cesium/pull/8941).
- Fixed JSDoc and TypeScript for `buildModuleUrl`, which was accidentally excluded from the official CesiumJS API. [#8923](https://github.com/CesiumGS/cesium/pull/8923)
- Fixed JSDoc and TypeScript type definitions for `EllipsoidGeodesic` which incorrectly listed `result` as required. [#8904](https://github.com/CesiumGS/cesium/pull/8904)
- Fixed JSDoc and TypeScript type definitions for `EllipsoidTangentPlane.fromPoints`, which takes an array of `Cartesian3`, not a single instance. [#8928](https://github.com/CesiumGS/cesium/pull/8928)
- Fixed JSDoc and TypeScript type definitions for `EntityCollection.getById` and `CompositeEntityCollection.getById`, which can both return undefined. [#8928](https://github.com/CesiumGS/cesium/pull/8928)
- Fixed JSDoc and TypeScript type definitions for `Viewer` options parameters.
- Fixed a memory leak where some 3D Tiles requests were being unintentionally retained after the requests were cancelled. [#8843](https://github.com/CesiumGS/cesium/pull/8843)
- Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893)

### 1.70.0 - 2020-06-01

Expand Down
54 changes: 54 additions & 0 deletions Documentation/Contributors/KTX2ModuleManagement/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Updating the KTX2 Transcoder Module

We use a custom build of the `msc_basis_transcoder` tool in Khronos's [KTX-Software](https://github.com/KhronosGroup/KTX-Software/) project to allow for IE11 compatability.

Updating the transcoder requires building both the web assembly version and Javascript fallback.

These directions were written against https://github.com/KhronosGroup/KTX-Software/commit/78790b5ea9c9f432a8e877fbc8cfd977617bb775.

### Web Assembly Build

Follow the instructions at https://github.com/KhronosGroup/KTX-Software/blob/master/BUILDING.md#webemscripten.

You will need a make tool as well as emscripten.

- Preferably, use Linux or [the Linux Subsystem for Windows 10](https://docs.microsoft.com/en-us/windows/wsl/install-win10) and `make` to build.
- Optionally, [MSYS2](http://www.msys2.org/). Follow installation instructions and add the path to MSYS2's usr/bin to your `PATH`. For example, if the path is `C:\msys64\usr\bin`, run `PATH=%PATH%;C:\msys64\usr\bin`.

### Javascript fallback build

As of this writing, `KTX-Software` does not provide an official configuration parameter for configuring the build to Javascript/asm.js instead of web assembly. An issue is open here: https://github.com/KhronosGroup/KTX-Software/issues/332

You will need to edit the project's `CMakeLists.txt` to include the required configuration flags.

1. Make a separate build directory for the Javascript fallback.
2. in `KTX-Software/CMakeLists.txt`, locate the variable `KTX_EMC_LINK_FLAGS`
3. add emscripten flags `WASM=0`, `LEGACY_VM_SUPPORT=1`, and `--memory-init-file 0`, ie.

```
set(
KTX_EMC_LINK_FLAGS
--bind
"SHELL:--source-map-base ./"
"SHELL:-s ALLOW_MEMORY_GROWTH=1"
"SHELL:-s ASSERTIONS=0"
"SHELL:-s MALLOC=emmalloc"
"SHELL:-s MODULARIZE=1"
"SHELL:-s FULL_ES3=1"
"SHELL:-s WASM=0" # for asm.js
"SHELL:-s LEGACY_VM_SUPPORT=1" # for asm.js
"SHELL: --memory-init-file 0" # for asm.js
)
```

4. Configure and build in the new directory. Be aware that the directions in the `KTX-Software` assume directory names, make sure to use the new directory, ie.

```bash
cd path/to/new/build/dir && cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="path/to/emsdk/Emscripten.cmake" && cmake --build
```

### Adding to Cesium

Note that both builds will produce a file called `msc_basis_transcoder.js`. Rename the web assembly version (the smaller file with a corresponding `msc_basis_transcoder.wasm`) before placing both in `Source/ThirdParty/Workers`.

Place `msc_basis_transcoder.wasm` in `Source/ThirdParty`.
82 changes: 41 additions & 41 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,58 +556,58 @@ https://github.com/mourner/quickselect
> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
> THIS SOFTWARE.

### crunch
## KTX-software

https://github.com/BinomialLLC/crunch
https://github.com/KhronosGroup/KTX-Software

> crunch/crnlib uses the ZLIB license:
> http://opensource.org/licenses/Zlib
> (Apache License)
>
> Copyright (c) 2010-2016 Richard Geldreich, Jr. and Binomial LLC
> With the exception of the files listed explicitly below, the source is made
> available under the Apache License, Version 2.0 (the "License"); you may not
> use these files except in compliance with the License. You may obtain a copy of
> the License at
>
> This software is provided 'as-is', without any express or implied
> warranty. In no event will the authors be held liable for any damages
> arising from the use of this software.
> http://www.apache.org/licenses/LICENSE-2.0
>
> Permission is granted to anyone to use this software for any purpose,
> including commercial applications, and to alter it and redistribute it
> freely, subject to the following restrictions:
> Unless required by applicable law or agreed to in writing, software
> distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> See the License for the specific language governing permissions and
> limitations under the License.
>
> 1. The origin of this software must not be misrepresented; you must not
> claim that you wrote the original software. If you use this software
> in a product, an acknowledgment in the product documentation would be
> appreciated but is not required.
> libKTX is the work of Mark Callow based on work by Georg Kolling and Jacob
> Ström with contributions borrowed from Troy Hanson, Johannes van Waveren,
> Lode Vandevenne and Rich Geldreich. The source contains code
>
> 2. Altered source versions must be plainly marked as such, and must not be
> misrepresented as being the original software.
> © 2010 ~ 2019 The Khronos Group Inc.
> © 2008 and © 2010 HI Corporation
> © 2005 Ericsson AB
> © 2003-2010, Troy D. Hanson
> © 2015-2020 Mark Callow
> © 2016 Oculus VR, LLC.
> © 2019 Binomial LLC. All Rights Reserved.
> © 2005-2019 Lode Vandevenne
> © 2019 Andreas Atteneder
>
> 3. This notice may not be removed or altered from any source distribution.

### crunch_lib.cpp

https://github.com/Apress/html5-game-dev-insights/blob/master/jones_ch21/crunch_webgl/crunch_js/crunch_lib.cpp

> Copyright (c) 2013, Evan Parker, Brandon Jones. All rights reserved.
> The KTX load tests are the work of Mark Callow with a few small portions
> borrowed from Sascha Willems' Vulkan examples and use Sam Lantinga's libSDL for
> portability. The source contains code
>
> Redistribution and use in source and binary forms, with or without modification,
> are permitted provided that the following conditions are met:
> © 2013 The Khronos Group Inc.
> © 2008 and © 2010 HI Corporation
> © 1997-2018 Sam Lantinga
> © 2016 Sascha Willems
> © 2015-2020 Mark Callow
>
> - Redistributions of source code must retain the above copyright notice, this
> list of conditions and the following disclaimer.
> - Redistributions in binary form must reproduce the above copyright notice,
> this list of conditions and the following disclaimer in the documentation
> and/or other materials provided with the distribution.
> `texturetests` and `unittests` are the work of Mark Callow and are based on gtest. The source contains code
>
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
> ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
> ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
> ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \*/
> © 2010-2020 Mark Callow
> © 2006 Google Inc.
>
> `transcodetests` are the work of and were contributed by Andreas Atteneder.
> The source contains code
>
> © 2019 Andreas Atteneder

### texture-tester

Expand Down
5 changes: 5 additions & 0 deletions Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ function supportsPointerEvents() {
return hasPointerEvents;
}

function supportsBasis(context) {
return context.etc1 || context.s3tc || context.pvrtc;
}

var imageRenderingValueResult;
var supportsImageRenderingPixelatedResult;
function supportsImageRenderingPixelated() {
Expand Down Expand Up @@ -304,6 +308,7 @@ var FeatureDetection = {
supportsPointerEvents: supportsPointerEvents,
supportsImageRenderingPixelated: supportsImageRenderingPixelated,
supportsWebP: supportsWebP,
supportsBasis: supportsBasis,
imageRenderingValue: imageRenderingValue,
typedArrayTypes: typedArrayTypes,
};
Expand Down
Loading