There is a picture of the DDS compression of normal map to illustrate the problem:
We can note that after the common dtx5 compression, the illumination details of those particles are greatly lost, And the raster phenomenon is also very serious.
At the same time, we can see that dxt5_nm saves the details well when the file size is the same.
Swizzled dxt5 format: It is basically dxt5 format, but the X value is put to a, and the Y value is put to G, R/B channel can be ignored, the reason is that the dxt5 compression feature makes the/G channel Compression Quality relatively high. The quality is much better than simply saving dxt5 to XYZ.
3dc: Only AMD (ATI) GPU is supported currently. The effect should be better than that of swizzled dxt5. (Because there is no ATI card at hand, there is no way to compare it)
|
|
The dxt1 compressed normal map on the right shows noticeable Blocking artifacts compared to the original normal map on the left. |
|
|
The dxt5 compressed normal map on the right Compared to the original normal map on the left. |
|
|
The dxt5 compressed normal map with re-Normalization On The right compared to the original normal map on the left. |
Keyword: 3dc dxt5_nm swizzle
I didn't see direct support for dxt5_nm in d3d. I used nvtt to generate normalmap in dxt5_nm format. Because xy = Ag, r = 1, the color is orange.
Processing in the shader
Float3 fvnormal;
Fvnormal. XY = (Tex2d (normalmap, texcoord). AG * 2.0f - 1.0f ); fvnormal. z = SQRT ( 1.0 - dot (fvnormal. XY, fvnormal. XY ));
rendering effect
link:
http://codefield.blogspot.com/2007/04/normal-map_6771.html
http://www.ozone3d.net/tutorials/bump_map_compression_p3.php#z_generation
http://code.google.com/p/nvidia-texture-tools/wiki/NormalMapCompression
http://developer.nvidia.com/object/real-time-normal-map-dxt-compression.html