@@ -151,9 +151,9 @@ the RGB color channels in some circumstances:
151151## Encoding normal maps
152152
153153The 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
158158To encode this we therefore want to store two input channels and should
159159therefore 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
192200For many use cases the alpha channel is an actual alpha opacity channel and is
193201therefore 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
195203A channel as LDR.
196204
197205For 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
199207which will treat all channels as HDR data.
0 commit comments