“This is the first day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021”
Currently, there are several commonly used graphics rendering apis:
- Direct3D
- OpenGL
- Vulkan
- Metal
The features of each API are described in detail below
Direct3D
Direct3D (referred to as: D3D) is Microsoft company in Microsoft Windows operating system developed on a set of 3D graphics programming interface, is a part of DirectX, currently widely supported by the display card. OpenGL is one of the two most commonly used graphing interfaces for computer graphics software and games, currently available only on the Windows platform.
OpenGL (Open Graphics Library)
OpenGL (Open Graphics Library or “Open Graphics Library”) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. This interface consists of nearly 350 different function calls to draw complex 3d scenes from simple graphics bits. OpenGL is commonly used in CAD, virtual reality, scientific visualization programs and video game development.
Efficient implementations of OpenGL (utilizing graphic-accelerated hardware) exist on Windows, some UNIX platforms, and Mac OS. These implementations are typically provided by the display device vendor and rely heavily on the hardware provided by that vendor.
The OpenGL specification is maintained by the OpenGL Architecture Review Committee (ARB), established in 1992. The ARB is made up of companies with a particular interest in creating a unified, universally available API. According to the OpenGL website, The June 2002 ARB voting members included 3Dlabs, Apple Computer, ATI Technologies, Dell Computer, Evans & Sutherland, Hewlett-Packard, IBM, Intel, Matrox, NVIDIA, SGI, and Sun Microsystems. Microsoft was a founding member, but withdrew in March 2003.
OpenGL ES OpenGL for Embedded Systems
OpenGL ES is a subset of OpenGL 3D graphics API, designed for embedded devices such as mobile phones, PDAs and game consoles. There are two major versions available, Opengles1.x for fixed pipe rendering and Opengles2.x and above for programmable pipe rendering. Most current mobile phones support OpenGLES2.0 or later. Compared with OpenGL, OpenGL ES cuts down all inefficient operation modes. If you have high performance, you will never leave the inefficient operation mode. That is, you only want efficiency, not compatibility.
Opengl-es is a fee-free, cross-platform, full-featured 2D and 3D graphics application programming interface (API) designed specifically for a variety of embedded systems — including consoles, mobile phones, handheld devices, appliances, and automobiles. It consists of a carefully defined subset of desktop OpenGL that creates a flexible and powerful underlying interface between software and graphics acceleration. OpenGL ES contains floating point and fixed point arithmetic system descriptions and EGL’s native Windows system specification for portable devices. OpenGL ES 1.X is designed for fixed-function hardware and provides accelerated support, graphics quality, and performance standards. OpenGL ES 2.X provides fully programmable 3D graphics algorithms including masking technology. OpenGL ES-SC is designed for special markets with high security requirements.
WebGL (Web Graphics Library)
WebGL (Full Write Web Graphics Library) is a 3D Graphics protocol that allows JavaScript to be combined with OpenGL ES 2.0. By adding a JavaScript binding to OpenGL ES 2.0, WebGL can provide hardware 3D accelerated rendering for HTML5 Canvas, so that Web developers can use the system graphics card to more smoothly display 3D scenes and models in the browser, as well as create complex navigation and data visualization. Obviously, the WebGL technology standard eliminates the need to develop web-specific rendering plugins that can be used to create web pages with complex 3D structures, even to design 3D web games, and so on.
WebGL is based on OpenGL ES 2.0, not pure OpenGL ES. WebGL works with the DOM through HTML5’s Canvas. As with OpenGL ES 2.0, GLSL is used as Shading Language (a C-like vertex computing and Shading Language, caged to GPU and executed by GPU). WebGL 2.0 is based on OpenGL ES 3.0, ensuring that many selective WebGL 1.0 extensions are provided and new apis are introduced.
WebGL, OpenGL and OpenGL ES
Through the above analysis, the following relationship can be obtained:
Vulkan
Vulkan is a cross-platform APPLICATION programming interface (API) for 2D and 3D graphics, first announced by The Khronos Group at the 2015 Game Developers Conference (GDC).
Konas first referred to VulkanAPI as the “Next Generation OpenGL Initiative” or “glNext,” but those names were dropped after Vulkan was officially announced. Just like OpenGL, Vulkan is designed for real-time 3D programs (such as video games), Vulkan also plans to provide high performance and low CPU overhead, which is also the goal of Direct3D12 and AMD Mantle. Vulkan is compatible with a branch of the Mantle and uses some components of the Mantle.
Vulkan is designed to provide lower CPU overhead with more direct GPU control, and the concept is roughly similar to Direct3D 12 and Mantle. Vulkan no longer uses OpenGL’s state machine design, nor does it store global state variables internally. Display resources are entirely managed by the application layer. Including memory management, thread management, multi-thread drawing command generation, render queue submission and so on. The application program can make full use of CPU’s multi-core and multi-thread computing resources, reduce CPU waiting and delay. The question is. Synchronization between threads is also the responsibility of the application, making it more demanding on the developer.
Metal
At WWDC 2014, Apple introduced Metal, a new platform technology for game developers that can provide 3D graphics with 10 times more rendering performance and support for familiar game engines and companies.
Metal is a new technology for developers of highly immersive console games, allowing them to fully exploit the capabilities of the A7 and A8 chips. The technology is optimized so that the processor and graphics processor can work together for optimal performance. It is designed for multithreading and provides excellent tools to integrate everything into Xcode.
conclusion
Common rendering engines such as Unity, Cocos2D-X, OpenSceneGraph, and Skia are all based on the above graphics API. In the final analysis, graphics rendering is achieved through the operation of GPU, but different platforms have corresponding graphics rendering libraries, OpenGL can be said to be the king of cross-platform.
The following table is a comparison of commonly used graphics rendering apis: