Commit Graph

11 Commits

Author SHA1 Message Date
Mathias Agopian
2ded1c955f cmgen and filament now support RGB_10_11_11_REV
- RGB_11_11_10 is exported in a RGBA PNG file where the 4 channels are
  used as a uint32 storing a RGB_10_11_11_REV pixel.
  We use the .rgb32f extension, and those PNG files contain garbage 
  when seen in a PNG viewer.

- This is now the default for the -x option.

- compressed KTX files don't encode RGBM, which means they can't
  support HDR, unless an HDR compression scheme is used.
2019-06-20 14:36:37 -07:00
prideout
5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
Philip Rideout
da698f2e36 Add high level compression API to prep for cmgen integration. 2018-10-05 10:11:48 -07:00
Philip Rideout
cc61e4649b Add ETC support to mipgen / imageio / suzanne.
This shrinks file size as follows, although it seems to darken the
rendered result.

```
  1398209 Oct  2 16:22 ao.ktx
   699172 Oct  2 16:20 ao_etc.ktx
  1398209 Oct  2 16:22 metallic.ktx
   699172 Oct  2 16:19 metallic_etc.ktx
  1398209 Oct  2 16:22 roughness.ktx
   699172 Oct  2 16:20 roughness_etc.ktx
```
2018-10-02 21:57:22 -07:00
Philip Rideout
3185d0f237 Add S3TC support to imageio and Suzanne.
At build time, mipgen now creates several compressed and non-compressed
variants for albedo.

For ASTC we use the ARM encoder, for S3TC we use the STB encoder. The
latter is somewhat limited so we may wish to investigate other libraries
in the future (e.g., AMD Compressenator).

At run time, we detect which of these variants to download, based on
available WebGL extensions. In practice, this means that desktop
browsers will use the S3TC variant and mobile browsers will use the ASTC
variant.

The makes unzipped albedo go from ~4 MB to 682 KB using S3TC.

Mobile support (ASTC and ETC2) is coming in a future PR, stay tuned.
2018-10-01 14:34:21 -07:00
Philip Rideout
6ed331d74c Add compression to mipgen and change bitrate to block size.
The compression API now takes block size instead of bit rate. Otherwise
it is quite possible for the encoder to generate a block size that is
not one of the valid block sizes that graphics API's can actually
consume.
2018-09-28 16:33:41 -07:00
Philip Rideout
17cfd55d3c Introduce compression API to imageio.
This wraps ARM's open source encoder with a reasonable interface.
2018-09-28 09:42:09 -07:00
prideout
3f751f3850 cmgen and mipgen should return an error code upon failure.
These tools can be used in an asset pipeline; build scripts should not
be required to parse stdout in order to determine success.
2018-09-17 14:51:29 -07:00
Philip Rideout
044387308a Migrate imageio to LinearImage. (#111) 2018-08-17 11:22:05 -07:00
Philip Rideout
b5b90b83f8 Add test_cmgen and promote the "updateOrCompare" function. (#95) 2018-08-14 13:47:31 -07:00
Philip Rideout
f8a8098e0f Split off imageio lib from image. (#36)
* Split off imageio lib from image.

* Remove duplicated math funcs.
2018-08-07 16:38:04 -07:00