Skip to content

Commit 509671b

Browse files
committed
Update markdown with latest 2.x updates
1 parent a28da24 commit 509671b

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

Docs/Building.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Building ASTC Encoder
22

33
This page provides instructions for building `astcenc` from the sources in
4-
this repository.
5-
6-
**Note:** The current `master` branch is configured to statically build
4+
this repository. The current `master` branch is configured to statically build
75
binaries which each use a specific level of SIMD support (SSE2, SSE4.2,
86
or AVX2) selected at compile time. Binaries are produced with a name postfix
97
indicating the SIMD type in use; e.g. `astcenc-avx2` for the AVX2 binary.
@@ -35,21 +33,22 @@ msbuild astcenc.sln /p:Configuration=Release /p:Platform=x64
3533

3634
## macOS and Linux
3735

38-
Builds for macOS and Linux use GCC and Make, and are tested with GCC 7.4 and
39-
GNU Make 3.82.
36+
Builds for macOS and Linux use GCC or Clang and Make. They are tested using
37+
Clang 9.0, GCC 7.4, and Make 3.82. Using Clang 9.0 is recommended, as Clang
38+
builds out-perform GCC builds by approximately 20% in benchmarked test runs.
4039

4140
### Single variants
4241

4342
To compile a single SIMD variant compile with:
4443

4544
```
46-
make -sC Source VEC=[nointrin|sse2|sse4.2|avx2] -j8
45+
make -C Source CXX=clang++ VEC=[nointrin|sse2|sse4.2|avx2] -j8
4746
```
4847

4948
... and use:
5049

5150
```
52-
make -sC Source VEC=[nointrin|sse2|sse4.2|avx2] clean
51+
make -C Source CXX=clang++ VEC=[nointrin|sse2|sse4.2|avx2] clean
5352
```
5453

5554
... to clean the build.
@@ -59,7 +58,7 @@ make -sC Source VEC=[nointrin|sse2|sse4.2|avx2] clean
5958
To compile all supported SIMD variants compile with:
6059

6160
```
62-
make -sC Source batchbuild -j8
61+
make -sC Source CXX=clang++ batchbuild -j8
6362
```
6463

6564
... and use:

Docs/Encoding.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ the RGB color channels in some circumstances:
151151
## Encoding normal maps
152152

153153
The best way to store normal maps using ASTC is similar to the scheme used by
154-
BC5; store the X and Y components of a unit-length tangent space normal. The
155-
Z component of the normal can be reconstructed in shader code based on the
156-
knowledge that the vector is unit length.
154+
BC5; store the X and Y components of a unit-length normal. The Z component of
155+
the normal can be reconstructed in shader code based on the knowledge that the
156+
vector is unit length.
157157

158158
To encode this we therefore want to store two input channels and should
159159
therefore use the `rrrg` coding swizzle, and the `.ga` sampling swizzle. The
@@ -163,9 +163,17 @@ OpenGL ES shader code for reconstruction of the Z value is:
163163
normal.xy = texture(...).ga;
164164
normal.z = sqrt(1 - dot(normal.xy, normal.xy));
165165

166-
In addition to this it is useful to use the `-normal_psnr` command line
167-
option, which switches the compressor to optimize for angular error in the
168-
resulting vector rather than for absolute color error in the data.
166+
In addition to this it is useful to optimize for angular error in the resulting
167+
vector rather than for absolute color error in the data, which improves the
168+
perceptual quality of the image.
169+
170+
Both the encoding swizzle and the angular error function are enabled by using
171+
the `-normal` command line option. Normal map compression additionally supports
172+
a dedicated perceptual error mode, enabled with the `-perceptual` switch, which
173+
also optimizes for variance in the normal vector over a small neighborhood.
174+
This can improve perceived visual quality by reducing variability that is
175+
amplified by specular lighting calculations, but it will reduce the apparent
176+
PSNR of the image.
169177

170178
## Encoding sRGB data
171179

@@ -191,9 +199,9 @@ handling the alpha channel.
191199

192200
For many use cases the alpha channel is an actual alpha opacity channel and is
193201
therefore used for storing an LDR value between 0 and 1. For these cases use
194-
the `-hdr` compressor option which will treat the RGB channels as HDR, but the
202+
the `-ch` compressor option which will treat the RGB channels as HDR, but the
195203
A channel as LDR.
196204

197205
For other use cases the alpha channel is simply a fourth data channel which is
198-
also storing an HDR value. For these cases use the `-hdra` compressor option
206+
also storing an HDR value. For these cases use the `-cH` compressor option
199207
which will treat all channels as HDR data.

0 commit comments

Comments
 (0)