DirectX - yesterday, today, tomorrow [1]

xiaoxiao2021-03-06  82

DirectX - yesterday, today, tomorrow [1] [original] dragon core x 2004-01-19

Now the type and quantity of the game are almost explosive growth, the production level of the game is constantly improving, then when the player is appreciating the beautiful effect in the game, have you ever thought about what has been created this? DirectX's words seem to be unfamiliar with the players, and now many game descriptions have "this game needs DirectX ... These" such words, even the acceleration mode option when 3ds max starts, "There are DirectX. So what is DirectX? Now let us unveil the mysterious veil on the face, and it is. First, the first DirectXDirectX is a set of APIs developed by Microsoft-based platforms, which is high-speed real-time animation rendering, interactive music and environmental sound equation for application development services. Starting from Windows 95, people have begun to contact DirectX2.0, and WindowsNT4.0 is DirectX3.0A, but there is no version of DirectX4. In Windows98, it is an indispensable core member in the Windows family operating system. DirectX5 is integrated in Windows 98, and DirectX 6 is integrated in Windows 2000. The DirectX 7 is integrated in Windows ME, while Windows XP is born with DirectX 8.1. Microsoft has developed a DirectX standard platform and cooperates with hardware manufacturers and gaming vendors to jointly update the upgrade DirectX standard. Hardware manufacturers have developed better products in accordance with this standard, and game developers develop games according to this standard. That is, regardless of whether the hardware supports some effects, as long as the DirectX standard, the game developer can write it into the game, when this game is running on the hardware, if this hardware makes this effect according to DirectX standard In the hardware driver, the driver is harness its hardware to calculate the result, and the user can enjoy this effect. This is the "hardware device independence", which is the true meaning of DirectX. Typically, Windows is very strict to hardware access, using the usual way, but DirectX has given developer's ability to directly access hardware through "Hardware Abstract Layer (HAL)". HAL not only solves hardware and compatibility issues, but also Developers can use it directly access to some hardware devices of the computer, such as direct memory control, rendering, keyboard, mouse, and control of the control, the direct audio mixing and output capability of the audio device, so therefore, Developers can make full use of hardware acceleration to optimize the performance of the program to a new height. If the target machine does not support the corresponding hardware acceleration, DirectX can also simulate the accelerator to provide a powerful multimedia environment. The DirectX family contains members with Direct3D, DirectDraw, DirectInput, DirectMusic, Directplay, DirectSound, and DirectShow. Second, DirectX family portraits pass the above introduction, I believe that readers have a probably understanding of DirectX. Let us know them one by one. 1, Direct3D, DirectDraw and DirectGraphics DirectDraw are the veteran of the DirectX family, which provides good support for high-speed 2D rendering, because it has the ability to direct access and fast transfer, so that the 2D graphic's drawing speed is relatively GDI. A qualitative leap, its rendering speed or even hundreds of gaps. When I remember the "Red Alert" and "Diablo", you don't forget the trial of DirectDraw.

DirectDraw is close to the ultimate, but with the rapid development of PC graphics technology, people will no longer satisfy the 2D graphics effect, and the pseudo 3D simulation through 2D technology is very lost, which is directly caused. The birth of Direct3D, the early Direct3D technology is not very perfect, there is still a certain gap with respect to 2D technology, until the graphics accelerator card supports hardware 3D special effects, Direct 3D gradually enters the right track, slowly display its performance advantage. Let's review history and see how Direct3D "Growth Process": DirectX6 adds the following new features: • Flexible vertex format of geometry • Vertical buffer storage of geometries • Support multi-texture rendering • Auto texture Manage • Optional depth buffer (using Z Buffer or W Buffer) • Direct3D in Direct3D in DirectX7 in DirectX 7 is added to the Direct3D in DirectX7 by concave convexes and water waves. And light (T & L) Support • Environmental map of cube surface • Geometric rendering • Improved texture rendering • Automatic texture coordinate generation, texture conversion, projection texture, and arbitrary face cut • D3DX practical library • Support Intel MMX architecture, Intel single instruction multiple data Flow (SIMD), SSE® and AMD® 3DNOW® architecture. DirectX's version of 8.0, although it still maintains forward compatibility, its structure has changed, and 3D graphics processing technology is gradually unified in Vertex Shader and Pixel Shader. Vertex Shader is used to describe and modify the geometry of the 3D object, and also used to control light and shadow; Pixel Shader is used to manipulate the color and appearance of the surface of the object. Direct3D and DirectDraw are two, the DirectX family has born a new member ----- DirectGraphics. It also adds a lot of exciting features: • Full integration of DirectDraw and Direct3D simplified program initialization procedures and improve data allocation and management performance, which will reduce memory consumption. At the same time, the integrated graphics application programming interface (API) allows parallel vertex input streams to achieve more flexible rendering. • Programmable vertex handling language allows you to write custom shaders such as deformed and gradient animations, matrix palette, user-defined illuminated models, general environment mapping, programmable geometry, or any other developer defined algorithm. • Programmable pixel handling language allows you to write custom hardware shaders, such as universal texture combination formulas, pixel light (concave map), suitable for image-by-pixel environment maps that implement photos (real)-level mirror effects or any other developer definition Algorithm. • Support multi-sampling rendering allows full view of anti-sample and multiple sampling effects, such as motion blur and depth of field (focus of the lens). • Point Elf allows high performance particle system rendering, such as spark, explosion, rain, snow, and so on. • 3-D spatial texture allows range attenuation, achieving pixel-based illumination and space atmospheric effects, or even more complex geometry applications. • Supports high dimensional maps to enhance its appearance and simplify content mapping from the 3-D content from the main 3-D creation tool. • Advanced technology includes 3D content creation tool plugins for outputting a Direct3D skin grid, using Direct3D a variety of different technologies, multi-resolution level detail (LOD) geometry, as well as high-dimensional surface data. • The index vertex is mixed to extend the support of geometric mixing, allowing matrices to be used to vertex mixing by specifying a matrix index. • Expanding the Direct3DX utility contains a lot of new functions.

The Direct3DX utility is a auxiliary layer on Direct3D for simplifying the general work of the 3-D graphic developer. It includes a Montuper, supports the operation of the grid, as well as the function of assembling the vertices and pixel shaders. DirectX has a major kernel structure change every upgrade, which will bring us huge visual impact. DirectX7 core T & L engines are simply abandoned. Therefore, for graphic chip developers, game developers, and users, DirectX 9 is indeed a "unique superior graphics technology". DirectX 9 "with a number of exciting new features": Direct3D graphics rendering tube

• Vertex Shader 2.0 and Pixel Shader 2.0 In DirectX9, Vertex Shader and Pixel Shader are upgraded to 2.0, they all support 64 or even 128-bit floating point color accuracy. The floating-point color increases in dynamic and accuracy to the image quality leap, so you can easily achieve the movie level in DirectX9! Contrast parameters for DirectX8 and DirectX9:

Vertex Shader 2.0 introduces processes, increasing conditional jump, loop, and subroutines. The Vertex program can now consist up to 1024 instructions (previously only 128 instructions), increased instructions bring more complex and powerful performance, new operations such as sinusoids, cosine, and other powerful functions greatly simplified code Write and can express more complex results. Vertex Shader 1.0 VertexShader 2.0 Powerful Programmable Pixel Shader is a true essence that implements a movie quality level. Pixel Shader 2.0 can support advanced programming languages ​​and assembly languages, and developers can also embed their assembly code into higher programs. The previous version of the Pixel Shader language is limited to only 6 material and 28 instructions, and the 2.0 version increases this upper limit to the maximum 16 material and 160 instructions, and has added a lot of enhanced operations and operations. .

Pixel Shader 1.4

Pixel Shader 2.0

In addition, various Shader tools, such as NVIDIA's CG language and ATI's render, make real-time graphical rendering, rapid speed, NVIDIA and ATI official DEMO are enough to explain this. Some interface definitions have also been improved in DirectX9, Vertex Shader and Pixel Shader provide an interface separately, and provide a common graphic interface, such as the drawing of the line segment, etc., which further mitigates the burden on the developer. • Floating-point color and 32-bit frame buffer formats currently most of the color representations (such as RGB) use 8-bit integers to represent red, green, blue, perhaps this is enough for display, but in operation seems far not enough. Due to the unparalleled part of the integer, when they pass the extremely complex mathematical operation of Pixel Shader, it will result in a large error, which can cause color obvious distortion. DirectX9 supports several floating point color formats, making it greatly improved. At the same time, DirectX9 supports accurate to 32-bit frame buffer formats per pixel, which can show the number of current brightness grades, which makes images look more clear and natural. In addition, DirectX9 also provides support for Displace Maps, and improved equipment simulation, and has no unexpectedly, and DirectX9 SDK has further extended the Direct3DX practical library, which improves development efficiency.

转载请注明原文地址:https://www.9cbs.com/read-121455.html

New Post(0)