Shader is an important part of OpenGL ES.
Brief introduction
The shader program is a program that runs on the GPU and is a program written in GLSL language.
Function
With OpenGL shaders, you can enrich rendering, and the features you can implement include:
(1) More authentic materials-metal, stone, wood, etc.
(2) More realistic lighting effects-area lighting, soft shadows, etc.
(3) Natural phenomena-fire, smoke, water, clouds, etc.
(4) Advanced rendering effects-global illumination, Ray tracker, etc.
(5) Non-photo grade material-painting effect, pen writing effect, etc.
(6) Some new uses of texture memory-vector storage, fuzzy values, polynomial coefficients, etc.
(7) Process textures-Dynamically generated 2D, 3D textures, etc.
(8) Image processing-convolution, complex mixing, fuzzy masking sharpening processing (unsharp masking), etc.
(9) Animation effects-keyframe interpolation, particle system, program-defined motion, and more
(10) Custom anti-aliasing method
(11) General calculation-sequencing, mathematical modeling, fluid dynamics, etc.
Classification
Vertex shader vertices can be understood as each point that makes up an object.
A vertex Shader is executed once for each vertex (vertex) that is sent to the GPU. The input data is: Attributes: Encapsulates data for each vertex using a vertex array, typically for variables with different vertices, such as vertex position, color, and so on.
Output data: At least the location information should be output at the vertex shader stage-that is, the built-in variable: gl_position, which is the intrinsic varying of each point, representing the space position of the point. The other two optional variables are: Gl_frontfacing and gl_pointsize.
- The fragment shader Fragment shader shader calculates the color and properties of each pixel.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android OpenGL ES Development shader