Unveil 3D textures
Author: Zhu Yun
Earlier this year, NVIDIA announced that Microsoft will adopt the volume texture compression format (volume texture compression format) developed by NVIDIA in the next-generation DirectX, referred to as VTC. This marks the first time that the 3D texture compression format has officially entered the mainstream field of 3D software and hardware. Its emergence will ease the high bandwidth demand for high-quality textures transmitted over the Internet, it will also make high-quality PC games more authentic and delicate.
3D texture Origin
The existing texture map is to paste different 2D flat images on the surface of a 3D object. The same object uses the same 2D texture to simplify the different surface effects of different objects, it not only saves resources for system storage and object surface information, but also reflects the objective (or imaginary) World. A 2D texture is a plane image (usually square). Therefore, it only includes pixels (called graphics and Texel) on a plane ), each point has only two-dimensional relative coordinates inside the texture (after being attached to an object, there is a three-dimensional actual coordinate ). Because the 2D texture is too simplified, it does not seem to have different texture in all directions. if the object is smooth, it is difficult to show the local level, there is almost no difference in illumination from different angles.
Various hardware and software companies have come up with a number of improvement methods to achieve more real and variable texture textures. Among them, 3D textures are the most thorough innovation path. 3D textures can be viewed as differentCubeBody material, including the entire volume of pixels (voxel ), each point has three-dimensional relative coordinates in the texture space-you can think of it as a marble (or crystal) Cube with an internal pattern. 3D texture maps are actually called 3D cube engraving and deformation. They are more suitable because they do not need to stick the pattern on the surface, but instead convert and distort the 3D texture to the shape of the final object. In this way, we have materials very close to the actual objects to form an illusory 3D world (the 3D Systems that eventually cancel textures and make every object different are still far away ), although the system resources we pay will increase in cubic order with the complexity of the texture (the system resources consumed by the 2D texture only increase in Geometric Order with the complexity of the texture ).
Development of 3D textures
It is hard to tell exactly when a 3D texture came into being: 3dlabs proposed the concept of a little height in permedia 3, and matrox started to use a concave and convex texture from g400, other 3D chips can also implement simple concave and convex textures, and then there are a variety of Environment textures (from different aspects to look a little different): g400 concave and convex environment textures (3-layer textures), NVIDIA geforce 256 cubic environment textures (6-layer textures) and ATI rage 6C environment textures (from 1-layer textures to 6-layer textures ). Now, 3D textures have real internal 3D relative coordinates (equivalent to dozens or even hundreds of layers of 2D textures ), so far, there are 3D textures of rage 6C and nvidia vtc mentioned at the beginning.
The advantages of 3D texture are self-evident. It provides a basis for the development of a new generation of more delicate and Realistic 3D graphics systems. The disadvantages of 3D textures are also as obvious as they are: first, a very large amount of data will occupy unimaginable system resources, in the process of 3D processing, it is also difficult to filter texture data and semi-transparent mixture. The bilinear filtering of 3D textures involves the average data of 8 points (2d textures only have four point ), it is close to the calculation of 2D Texture tri-linear filtering (9 points). The semi-transparent 3D texture mixing involves the color mixing of a lot of multi-layer pixel data, and the calculation is quite large. In addition, 3D textures are just as simple as being "carved" into objects now, and will inevitably undergo geometric deformation of 3D textures in the future. In the past, T & L engines (and CPUs) it is only responsible for the geometric transformation of object vertices, so that we have to calculate the spatial coordinates of each point in the 3D texture. It is hard to imagine that the calculation of floating point geometric transformation is not implemented in a short time.
3D texture Compression
Let's take a look at the amount of 3D texture data. 2d textures are generally square, such as 256x256 (graphics) and 512x512, and the maximum is 4096x4096. 3D textures are generally cubes, for example, 32 × 32 × 32 (Body element), 64 × 64 × 64, and so on, the maximum temporarily can only have 256 × 256 × 256. Because 256 × 256 × 256 is a 16 m prime point, the color precision of each 16-bit (2 byte) or 32-bit (4 byte) is 32 MB or 64 MB, that is to say, the mainstream display card memory can only hold a low-grade 3D texture (in the voodoo era, the standard for 2D Large textures is 256x256/16 bits ). Therefore, 3D textures must be compressed before they can be of practical value.
When it comes to image compression, we will surely think of Static Image Compression formats such as JPG and GIF and MPEG dynamic image compression formats, but practical texture CompressionAlgorithmThe following conditions must be met: 1. High-Speed and real-time decompression without affecting the texture Paster process speed. Therefore, JPEG (Static Image expert group) and wavelets (Wavelets) the method with high compression rate and low speed is not suitable (tried s3tc texture CompressionProgramFriends can find that s3tc format graphics files are much larger than JPG files with a higher compression factor, generally 1/2 ~ 1/4); second, we must be able to partially decompress the entire texture, that is, we do not need to decompress the entire texture (there are a lot of data related algorithms like this, for example, MPEG must be based on the previous image to calculate the next frame, because there is no "place" to store the decompressed data (if you want to store all the data, the meaning of compression is lost ), in fact, only a small amount of high-speed cache can be used to buffer the texture data currently used.
There are three main compression methods for 2D textures: videologic's earliest VQ (vector quantization, vector compression) and S3 s3tc (dxtc for Microsoft in DirectX 6 and s3tc for OpenGL), 3dfx fxt1 (dxtc release), the maximum compression rate is 1/6 ~ 1/8. These compression methods are used to create an index table composed of multiple graphic units, and replace the original data with the address (index number) in the index table to greatly reduce the data volume. The difference is that s3tc and fxt1 create different index tables in multiple parts of the texture, so the compression effect for small textures is as good as that for large textures; VQ only creates an index table for the entire texture. The larger the texture, the higher the compression ratio.
The 2D Texture compression method is easily extended to the 3D texture field. nvidia and ATI have not published details about their 3D texture compression methods, however, we can estimate that s3tc is a realistic standard for 2D Texture compression, NVIDIA's new 3D texture compression standard VTC should be based on it (NVIDIA recently reached a Patent License Agreement with S3), with at least a considerable number of similarities. It is certain that 3D texture compression requires a great compression rate to minimize the size of 3D texture data in astronomical numbers. If VTC can achieve a compression rate of about 1/100, the mainstream 1024x1024x1024/32-bit textures can be controlled within the tolerable 32 MB ~ 40 MB.
3D texture implementation
Because 3D texture textures and compression require powerful hardware support, it is difficult to use software simulation. NVIDIA announced that it will start using the VTC standard by the middle of this year, when geforce2 (codenamed nv15) and nv11 will be fully launched, therefore, we can infer that at least geforce2 will certainly have the VTC standard 3D texture Paster and compressed hardware acceleration function. The launch date of New Products codenamed rage 6C is likely to be similar to geforce2, and Ati's Hardware 3D texture feature will also be unveiled in rage 6C. The difference is that NVIDIA emphasizes linear access to 3D texture data, while ATI focuses on existing OpenGL compatibility.
New 3D features cannot be used without software, and API compatibility and support are particularly important. OpenGL 1.2 supports s3tc, T & L, and 3D textures, but adopts an open "laissez-faire" attitude towards texture compression. direct3d in DirectX is improved from version 5.0, in addition, the popularity of Glide exceeds that of OpenGL and 3dfx "private". From version 6.0, it includes s3tc (dxtc) from S3. It is also from nvidia t & L since version 7.0, now the new version of DirectX will support the VTC 3D texture compression standard. It looks like it will be released this summer, and it plans to surpass OpenGL's 8.0 version in various aspects.
When both hardware and software are in place, we hope that 3D textures will be widely accepted by the gaming industry, at least it must be close to the popularity level of T & L to be successful.
Prospect of texture technology
3D texture is another major change and improvement of the mainstream 3D Architecture following T & L. For the first time, the development of mainstream 3D with game as the target is ahead of the professional 3D with graphics as the center. But at the same time, 3D textures are a "good way" to double the processing capability of 3D chips every six months. Otherwise, how many people are planning to buy a new 3D display card?
Because 3D textures have distinct advantages and weaknesses, 3D textures and 2D textures will coexist for a long time, it does not change until the system resources are extremely rich or new algorithms can generate complex and low-volume textures. In the future, more layers (or even different depths) of 2D textures will be used to show richer graphic effects and 3D textures will be used to express important and complex objects, the two complement each other to achieve the optimal balance between the image quality and speed. In addition, the use of 3D textures poses a very different challenge for developers: Who will waste a lot of time for patterns not visible inside the marble? Therefore, the acceptance and use of 3D textures must be a long-term process.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/baickl/archive/2006/01/18/583451.aspx