OpenGL for android development (2)

GLSL language

Glossary:

1. Primitives: functions used by graphics software to describe various graphics.
2. OpenGL rendering pipeline
Rendering pipeline: It is a parallel processing unit that processes graphics signals inside the graphics card chip independently of each other. A simple understanding is a process of converting data to OpenGL and generating the final image!
3. What is GLSL?
GLSL is a programming language specially designed for graphics development.
4. Programming stage of programmable pipeline
write picture description here
Vertex processing stage: It consists of vertex shader, subdivision shader and geometry shader. The main function is to determine the location of primitives.
Vertex shader: After the initialization of the buffer data is completed, the vertex shader starts to accept the vertex data, and processes each vertex individually. After the vertex is processed, the subdivision shader is activated.
Subdivision shader: divided into subdivision control shader and subdivision calculation shader. It is used to describe the shape of the object, generate new geometry in the pipeline, and process this geometry more smoothly, and then it will become the final state.
Geometry shader: The subdivision shader passes the final model to the geometry shader. In fact, these primitives are modified inside the pipeline, because some are suitable and some are not, so when the geometry shader begins to modified images, changing the type of geometric primitives or discarding useless primitives.
Fragment processing stage: consists of fragment clipping, rasterization, and fragment shaders. It mainly determines the existence of the fragment and the color of the fragment.
Primitive Clipping: Clips out primitives that we cannot see (outside the viewport) before rasterization.
Rasterization: The process of converting a mathematical description of input primitives into pixel fragments corresponding to screen locations.
Fragment shader: It mainly deals with individual fragments after rasterization, mainly calculates the color and depth values ​​of the fragments, and then starts to pass them to the fragment testing and mixing modules. Here like lighting, fog processing is in this step.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324600446&siteId=291194637