Sometimes you want your KTX file to end in an extension other than
".ktx". For example, GitHub Pages applies gzip encoding to bmp files
but not to ktx files (which I think is consistent with nginx defaults).
This change makes it so that a deploy script can rename the files and
apply a simple string transformation to the HTML.
- front and back labels where inverted:
+z is the front of the cube and -z is its back
when looking at the cube from the outside
with a camera pointing towards -z (and the cube
in front of it). This is the GL definition.
- make the synthetic uvXXX debug environment
colors match those of the debug environment
(except for -Z/back which is magenta instead
of black).
- add some documentation about skybox and cube map.
- cmgen now creates reflections maps for all input
assets by default instead of just for equirectangular
images.
- equirectangular decode doesn't mirror -- that's
done by the mirroring code now.
- mirroring can be turned of with --no-mirror
- option --mirror is gone
- faster mirroring code (do it before generating
mipmaps)
- added labels to faces of debug.png environment
- added a debug equirectangular image in third_party
(creative commons license)
- KTX / OpenGL are PX,NX,PY,NZ,PZ,NZ.
- Cubemap::Face is NX,PX,NY,PY,NZ,PZ.
I considered changing the Cubemap::Face enum, but applying ^1 upon
export seems less intrusive.
For each envmap/skybox pair, this will reduce the number of downloads
from 61 files to 3 files.
Note that we are still using sh.txt for coefficients, I'll see if it
would be easy to embed that in the KTX metadata.
Also, I will add KTX support to roughness-prefilter soon.
* Ability to add code prior to prepareMaterial
* Add normal input on shading node
* Add constant float node
* Add multiply and subtract nodes
* Split math nodes out into MathNodes.kt
(1) Suzanne's normal map is actually linear but we were telling GL that
it is SRGB, so the shader was not reading (0.5,0.5,1.0) from a perfectly
flat normal map.
(2) --linear in mipgen was not honored when consuming PNG files.
(3) The build was not passing --linear to mipgen for the normal map.
To determine PNG vs KTX, we were looking at the file extension of the
asset name rather than the actual file path (which is a URL).
Also, le singe était trop sombre, so I added a call to setIntensity.
In Chrome, this reduces texture load time from 620 ms to 150 ms because
it removes the PNG decoding work for the surface textures. We are still
using PNG for the envmap, I'll fix that soon.
Many web servers, including GitHub Pages, automatically use gzip
encoding for these files. Over the wire these files actually are not
much bigger than the PNG, even though they contain miplevels.
Stay tuned for compressed textures, which should make this better.
The libimage API does not include the original image in the returned mip
array, which might make sense when generating individual files, but for
a KTX bundle, we want to include level 0.
I tested the validity of the resulting KTX files by using macOS Preview,
which can read some types of KTX files. (!)
This CL also adds mipgen to the WebGL build, although its outputs are
not yet used by the sample apps.