Graphics-Graphics interface

Introduction of some graphics concepts, personal excerpts or sorting, as the entry quotes of personal articles;

Graphical programming interface :

It is very troublesome for developers to directly access the GPU. We may need to deal with various registers and video memory; and the graphical programming interface implements a layer of abstraction on the basis of these hardware;

OpenGL and DirectX are these graphics application programming interfaces. These interfaces are used to render two-dimensional or three-dimensional graphics; these interfaces set up a communication bridge between the upper-level application and the underlying GPU; an application sends rendering commands to these interfaces, and these interfaces will Send rendering commands to the Graphics Driver in turn. These graphics drivers are the role that really knows how to communicate with the GPU. It is they who translate the function calls of OpenGL or DirectX into a language that the GPU can understand. At the same time, they are also responsible for translating The texture and other data are converted into the format supported by the GPU. It can be said that the graphics card driver is the operating system of the graphics card:

The picture is from "Unity Shader Getting Started Essentials"

Generally speaking, the application program runs on the CPU, and the application program can store the data required for rendering, such as vertex data, texture data, material parameters, etc., in a specific area of ​​the video memory by calling the graphics interface of OpenGL and DirectX;

Later, developers can issue rendering commands through the image programming interface. These rendering commands are also called Draw Call . They will be translated by the graphics card driver into codes that the GPU can understand for real drawing;

GPU can store any data in video memory, but some data types are necessary for rendering, such as image buffer and depth buffer for screen display;

Because of the existence of the graphics card driver, almost all GPUs can work with both OpenGL and DirectX; from the perspective of the graphics card, in fact, it only needs to deal with the graphics card driver;


 

Guess you like

Origin blog.csdn.net/DoomGT/article/details/114631841