OpenGL ES 3.0 Vertex coloring tool (1), opengles

Source: Internet
Author: User

OpenGL ES 3.0 Vertex coloring tool (1), opengles

OpenGL ES 3.0 Flowchart

1. Vertex Shader (Vertex Shader)

Vertex coloring implements a general programmable method for vertices.

The vertex shader inputs include the following:

• Shader program. Source Code or executable program of the vertex coloring program, which describes the operations to be performed on the vertex.

• Vertex shader inputs (or attributes)-an array of vertices supported by Vertex coloring.

• Uniforms. Constant data used by the vertex (fragment) shader.

• Samplers. Special types used by Uniforms, used in textures (Texture)

In OpenGL ES2.0, the output of the vertex shader is called a variable and renamed in 3.0. In the initial grating phase, it calculates each generated output value and passes it as an input to the fragment shader. The mechanism used to generate each value is called interpolation from vertex coloring to the original fragment of each vertex. In addition, OpenGL ES 3 and

A new feature is called transform feedback, which allows Vertex coloring output to be written to the output buffer.

Vertex shader

It is used in traditional vertex-based operations. Such as matrix transformation, computing light, generating the color of each vertex, texture generation, and coordinate transformation.

2. uniform mat4 u_mvpMatrix; // matrix to convert a_position3. // from model space to normalized4. // device space5.6. // attributes input to the vertex shader7. in vec4 a_position; // position value8. in vec4 a_color; // input vertex color9.10. // output of the vertex shader - input to fragment11. // shader12. out vec4 v_color; // output vertex color13. void main()14. {15. v_color = a_color;16. gl_Position = u_mvpMatrix * a_position;17. }

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.