Skip to content

Commit 1e8f371

Browse files
authored
Update README.md
1 parent 55a58e0 commit 1e8f371

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

webgl/README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ Requires WebAssembly and WebGL support. The WebGL demos are hosted live [here](h
44

55
To build the encoder and transcoder WASM libraries using Emscripten, see the various README.md files in the 'webgl/transcoder' and 'webgl/encoder' folders. The Javascript API wrappers to the C/C++ library are located in [`webgl/transcoder/basis_wrappers.cpp`](https://github.com/BinomialLLC/basis_universal/blob/master/webgl/transcoder/basis_wrappers.cpp).
66

7+
## KTX2 Compression, Transcoding, Display (ktx2_encode_test)
8+
9+
Live demo: [`ktx2_encode_test/index.html'](https://subquantumtech.com/xu/ktx2_encode_test/)
10+
11+
This demo shows how to use the compressor and transcoder from JavaScript. To use it, select a .PNG file then hit the "Encode!" button. The compressor will dynamically generate a .ktx2 file in memory which will then be immediately transcoded and displayed. Hit the "Download!" button to locally download the generated .ktx2 file.
12+
13+
To view the compressor's textual debug output, open your browser's developer debug console (under Developer Tools in Chrome) and enable the Debug checkbox before hitting the "Encode!" button. Multithreading and WASM64 are optionally supported, and a browser supporting both are highly recommended.
14+
15+
![Screenshot showing the encode_test demo](ktx2_encode_test/preview.png)
16+
717
## Transcoder (texture_test)
818

919
Live demo: [webgl/texture_test/index.html](https://subquantumtech.com/xu/texture_test/)
@@ -21,6 +31,8 @@ On browsers that don't support any compressed texture format, there's a low-qual
2131

2232
![Screenshot showing a basis texture rendered as a 2D image in a webpage.](texture_test/preview.png)
2333

34+
*Note: This sample doesn't support all ASTC/XUASTC LDR block sizes yet, just 4x4. See the "ktx2_encode_test" or "video_test" samples, which do.*
35+
2436
## glTF 3D Model
2537

2638
Live demo: [`gltf/index.html`](https://subquantumtech.com/xu/gltf/)
@@ -41,16 +53,6 @@ extension that is [currently in development](https://github.com/KhronosGroup/glT
4153

4254
![Screenshot showing a basis texture rendered as the base color texture for a 3D model in a webpage.](gltf/preview.png)
4355

44-
## Compressor (ktx2_encode_test)
45-
46-
Live demo: [`ktx2_encode_test/index.html'](https://subquantumtech.com/xu/ktx2_encode_test/)
47-
48-
This demo shows how to use the compressor from JavaScript. To use it, select a .PNG file then hit the "Encode!" button. The compressor will dynamically generate a .ktx2 file in memory which will then be immediately transcoded and displayed. Hit the "Download!" button to locally download the generated .ktx2 file.
49-
50-
To view the compressor's textual debug output, open your browser's developer debug console (under Developer Tools in Chrome) and enable the Debug checkbox before hitting the "Encode!" button. Multithreading is not currently supported when the compressor is compiled to WebAssembly, so compression will be slower than using the stand-alone command line tool.
51-
52-
![Screenshot showing the encode_test demo](ktx2_encode_test/preview.png)
53-
5456
## Testing locally
5557

5658
You can locally host the files under the "webgl" folder. One way is to use [Python to setup a local webserver](https://pythonbasics.org/webserver/) in the 'webgl' directory:
@@ -60,4 +62,4 @@ cd webgl
6062
python3 -m http.server 8000
6163
```
6264

63-
Note: For WASM multithreading to be available and enabled, the server [must be properly configured](https://unlimited3d.wordpress.com/2021/12/21/webassembly-and-multi-threading/). See the `webgl/start_webserver.sh` and `webgl/webserver_cross_origin.py` example scripts.
65+
**Note: For WASM multithreading to be available and enabled, the server [must be properly configured](https://unlimited3d.wordpress.com/2021/12/21/webassembly-and-multi-threading/). See the `webgl/start_webserver.sh` and `webgl/webserver_cross_origin.py` example scripts.**

0 commit comments

Comments
 (0)