Comparison between OpenGL and DirectX

One important manifestation of Linux's poor usability is its poor support for games. Of course, Linux also has numerous games, such as Solitaire, Penguin Ski, and Bubble Dragon. The playability of these small games is absolutely as high as that of Windows Solitaire, Minesweeper, and so on
However, the games we are referring to are large-scale games like Warcraft and Allied Expendables. The lack of such large-scale games in the Linux environment is partly due to the low market share of Linux, and developers believe that the cost of investing in games under Linux is high and difficult to recover; On the other hand, Linux does not support DirectX, a crucial driver for gaming
There are generally two types of game drivers - OpenGL and DirectX. OpenGL drivers are not only important in gaming, but also play a crucial role in graphics processing. So everyone can see the OpenGL settings options after installing the graphics card driver. Almost all operating systems (Windows, Linux, MacOS) support OpenGL. DirectX is a set of drivers (programming interfaces) specifically designed by Microsoft for games, which existed in the Windows 3 generation and has since been released as Direct9.0. During this period, various games also showed explosive growth momentum, which cannot be said to have nothing to do with DirectX.

Analyzing OpenGL 2.0 .

If OpenGL has always been leading Microsoft's Direct3D in terms of 3D APIs, do you agree? Perhaps you will agree with this statement to some extent, because many games created using OpenGL in the past (such as the famous Quake III) had more exquisite graphics and richer details than Direct3D games; Perhaps you would say that Direct3D has matured a lot recently and has been able to achieve a considerable level of excellence, but this is something that has happened since the emergence of DirectX 8.0/9.0. When the new OpenGL 2.0 emerges, the situation may be different again.

OpenGL 1. X Review .

Since the beginning of 1991, the OpenGL API has been an important component of professional 3D graphics technology, from professional movie special effects production to gaming, OpenGL has demonstrated its skills in many fields, using the OpenGL 1. X standard at that time. OpenGL is a standard that is both open and strict. It originated from the famous IRIS GL developed by SGI for its graphics workstations and evolved into OpenGL (meaning open) through cross platform porting.

In the field of computer 3D, the reason why OpenGL quickly surpassed other competitors and became popular is largely due to its design as a 3D API independent of hardware and operating systems from the beginning. So OpenGL itself is not limited to the types of operating systems, it can run on various computers using different operating systems, and can work in client/server mode in network environments. Naturally, OpenGL has become the standard graphics API for high-end applications such as professional graphics processing and scientific computing.

When it comes to OpenGL, I have to mention the ARB organization that manages this API system. OpenGL was originally developed by SGI, but later it was controlled by the independent consortium OpenGL ARB (Architecture Review Board) established in 1992. ARB members voted to generate standards and published them in specification documents. Each software and hardware manufacturer developed applications on their own systems based on these standards. Only by passing all tests of the ARB standards can they be considered compliant with OpenGL standards. Due to its excellent operational mechanism, ARB actively developed the OpenGL standard and approved version 1.1 in December 1995; Approved version 1.2.1 in May 1999; The current latest version is version 1.3 released in August 2001.

From 1. X to 2.0.

Although OpenGL was not specifically designed for gaming, most people understand OpenGL through gaming. Before the release of version 2.0, OpenGL encountered considerable difficulties in entering the desktop gaming market, with the initial resistance coming from Glide. In the mid to late 1990s, the Glide 3D API used by 3dfx on Voodoo, with its excellent performance and execution efficiency, almost kept OpenGL and Direct3D out of the home gaming market. Later, the rise of Direct3D from DirectX 5.0 made OpenGL very embarrassed for a while, due to the cube mapping and hardware T& amp; amp; L. The 3D world constructed with programmable pixel effects is no worse than OpenGL. Basically, OpenGL only excels in a few games such as Quake III and CS in the mainstream desktop operating system of Windows.

Of course, during the development of OpenGL and Direct3D, SGI and Microsoft, representing the pioneers of OpenGL and Direct3D respectively, once attempted to integrate OpenGL into DirectX and establish a universal API that could run inside and outside of Windows. This would elevate drawing development to a common architecture, which was the fascinating Fahrenheit project at the time. However, it has been proven that the implementation of the Fahrenheit plan is too difficult. Both Microsoft and SGI expect their APIs to dominate the plan, and the conflict between the two cannot be reconciled. The plan ultimately came to an end. Afterwards, Microsoft devoted all its resources to the development of DirectX, which led to the current brilliant situation of DirectX.

Naturally, at the same time, ARB has not relaxed the development of OpenGL, but the prospects are not optimistic. The most disappointing thing is that the only progress in recent years has been the release of OpenGL extension instructions such as ClearCoat and Multisample, without substantial progress, so the release of OpenGL 2.0 is urgent.

OpenGL 2.0 draft .

The main creators of the OpenGL 2.0 standard were not the original SGI, but 3Dlabs, which gradually took the lead in ARB. 3Dlabs believes that the main issues faced by OpenGL are:

1. The system and image architecture have undergone significant changes since 1992, with 3D APIs for games primarily based on Glide and DirectX becoming mainstream (or once mainstream) in the home gaming market. However, it is evident that OpenGL has not kept up with the pace and has never gained enough influence in the home gaming market.

2. Nowadays, graphics cards have become increasingly advanced in terms of functionality and performance, but OpenGL's functions cannot fully utilize the performance of these excellent hardware. Therefore, the current OpenGL 1. X has fallen behind the functionality and performance of today's advanced hardware.

3. In fact, there are also good games under OpenGL, such as Quake III, but its complexity in implementation and application far surpasses other 3D APIs, so usability is currently a major issue for OpenGL.

In the concept of 3Dlabs, the goal of OpenGL 2.0 version is to:

1. Take OpenGL to a new level, like D3D, where the core provides all hardware functions to complement current and future display hardware.

2. Show a picture of the next generation of programmable graphics hardware, using high-level languages instead of assembly to program graphics cards.

3. Replace most extension functions with well-defined core functions and complexity with programmability.

4. Maintain ideal compatibility with existing programs to ensure that old programs can run normally without modification and remain efficient.

5. For situations where compatibility is not required, provide a concise and clean core, and eliminate outdated functions.

6. Improve the functionality and efficiency of dynamic media such as dynamic materials to meet the needs of dynamic media processing.

ARB has accepted the proposal from 3Dlabs to develop the OpenGL 2.0 architecture, and they have also outlined a clear development path. The main and recent goal of OpenGL is to launch and develop hardware programmability, which may be its main weapon against Microsoft D3D in the gaming market. Of course, it is undeniable that OpenGL also needs to be updated elsewhere.

Analysis of OpenGL 2.0 .

Just having one idea is not enough, OpenGL needs to be put in front of people in order to gain sufficient support. So with the help of this concept and continuous improvement, OpenGL 2.0 now has a fairly clear model.

The most important update of OpenGL 2.0 after its formation is the addition of programmability. To meet the standards of most applications and users, it will provide a rich set of features like the previous OpenGL 1. X, independent of hardware and specifically designed for use within the OpenGL architecture.

compatibility.

The first thing that the new OpenGL 2.0 standard needs to do is compatibility with OpenGL 1.3, and it should be complete compatibility. To achieve this, OpenGL 2.0 designed by 3Dlabs will consist of the existing features of OpenGL 1.3 along with new features that are fully compatible with it. This not only maintains compatibility, but also thoroughly simplifies the various tangled extension instruction sets released by various companies in the era of ARB stagnation.

The reason why OpenGL once stood still for a period of time was because there were too many chaotic extension instruction sets, many of which were designed for specialized applications. Although OpenGL is an open world, these self-developed instructions contain their own intellectual property rights, which may lead to a lot of disputes. Manufacturers are also unwilling to give up their own interests and incorporate these new instructions into the OpenGL standard for everyone to share. In the past few years, due to such reasons, ARB has been busy sorting out internal relationships and has no time to think about the development of new OpenGL technologies, which has led to the stagnation of OpenGL. Therefore, streamlining the extension instruction set is necessary.


.

Shading language for OpenGL 2.0 .

In 2002, NVIDIA invested a lot of effort in promoting interactive 3D program development, with the most significant being the CG graphics language (also known as the "C language for graphics technology" - C for graphics, which NVIDIA developed as an advanced lighting effects programming language to surpass DirectX and OpenGL). NVIDIA is attempting to submit this language to ARB, hoping that it will become a standard recognized by the OpenGL organization. But in the end, the Shading language used by ARB was Glslang from 3Dlabs, which virtualized resource pipelines. Due to OpenGL's memory management being still a black box operation, all tasks would be automatically processed. Therefore, for most programmers, there is no need to consider resource management.


.

Scalability .

If it is only a simple simplification, it will inevitably lead to a decrease in the functionality of OpenGL instructions. The reason is simple, because the available instruction set is reduced. So while streamlining, it is necessary to expand the functionality of instructions, which means defining new features for the remaining "old" instructions. OpenGL 2.0 has increased the capabilities of fragment processors, replacing traditional interpolation vertex data operations, pixel scaling, material access and application, atomization, and more. Programmable image formats will replace fixed format encapsulation and unpacking operations, allowing for arbitrary combinations of types and formats when transmitting or receiving pixel data.


.

Programmability .

Among all these extension features, programmability is the most attractive. Developers can leverage the programmability provided by OpenGL 2.0 to replace complex features with rich and long-lasting features, reducing the need for existing and future extension instructions.

The most famous programmable feature should be programmable vertices, which allow for random individual vertex operations and also replace some old OpenGL pipelines, such as vertex conversion, regular conversion, lighting, color enhancement, material coordinate generation and conversion, etc. Related to it are programmable fragment processing and programmable image formats, with the former mainly responsible for material access, interpolation operations, and pixel operation flexibility, which will replace interpolation vertex data operations.

Programmability should be considered the most attractive aspect of OpenGL 2.0, as at least all extension applications have a minimum standard. Under the programmable language, all development becomes very simple, and there will be no confusion in research and development due to potential property disputes as before.

Enhance data management performance.

The data types in OpenGL mainly include vertex data (color, normal, position, user-defined, etc.) and image data (material, image, pixel buffer, etc.). OpenGL 2.0 provides better data mobility and memory management capabilities, enhancing application control over data mobility and better vertex processing capabilities. It can eliminate data backups generated to increase data traffic and significantly improve performance.


.

Manufacturer support situation .

The large vendor camp in ARB itself has strong support for OpenGL 2.0, and 3Dlabs will definitely add strong support for the OpenGL 2.0 standard in the latest professional graphics cards.

In terms of other manufacturers, ATI is one of the more active ones in supporting the OpenGL 2.0 specification. With the launch of RADEON 9500/9700 and other series of chips, ATI has also made significant moves in the field of professional graphics cards. Three months after the launch of these home display chips, ATI announced the FireGL professional graphics card, which comes with 128MB of graphics memory and is the first professional 3D accelerator card on the market to support programmable floating-point structures. Among its supported APIs is OpenGL 2.0. There are two versions of FireGL, one is the FGL 9700 Visual Processing Unit (VPU), and the other is the slower version of FGL 9500 (corresponding to the RADEON 9500 chip, known as FireGL Z1), both of which have 128MB of graphics memory.

The FireGL X1-128MB appeared on the market in December last year, with a recommended selling price of $795; The FireGL Z1 was also recently launched, with a suggested price of $595. It is said that a 256MB version of the FireGL X1 will also be available soon. It can be seen that the famous graphics card manufacturer ATI has spared no effort in supporting the OpenGL 2.0 specification, which may be related to NVIDIA's Cg being excluded from the specification.

Although ARB ultimately adopted the 3DLabs design scheme on Shading, NVIDIA's urgent desire to occupy a place in ARB is clear at a glance. However, a pair of old enemies, ATI and NVIDIA, have also begun to integrate technologies related to OpenGL through ARB. SGI and 3Dlabs in the professional market, as well as ATI and NVIDIA in the home market, have all been embraced by OpenGL 2.0, and such a lineup is already strong enough. The rest depends on how software developers can make good use of the new features of OpenGL 2.0 to create better and more dazzling effects for us.


.

DirectX and Glide API .

DirectX is an API developed by Microsoft specifically for games. Its biggest advantage is that it is easy to program and control the program. The functions included in it are also easy to call, but it is not as professional as OpenGL. DirectX has gradually matured since version 5.0 and has now evolved to version 9.0. Most common 3D games now support Direct3D in DirectX.

Glide is a 3D API specially designed by the former 3D graphics card king -3dfx to leverage the powerful performance of its Voodoo chips. As it is specifically designed for the Voodoo series of 3D acceleration cards, there is no need to consider too many compatibility issues. Therefore, Glide's execution efficiency is much higher than that of OpenGL and Direct3D at the time, but its disadvantage is that it only supports Voodoo series products.