OpenGL ES 3.0 vertex shader (ii)

Source: Internet
Author: User

 
vec4 a_position ;   inch VEC4 A_color;
Out VEC4 V_color;
void== U_mvpmatrix * a_position;}

Above is a vertex shader code.

 + ES

Appears in the first line of the vertex shader file, indicating that the shaded language version is 3.0 (Shading Language 3.0)

Uniform mat4 U_mvpmatrix;

Creates a uniform variable U_mvpmatrix that is used to store the combined model view projection matrix.

inch VEC4 a_position;  in Vec4 a_color;

Input to the vertex shader as a property of the vertex shader.

A_position is the position property of the input vertex, and A_color is the color attribute of the input vertex.

 out VEC4 v_color;

Output vertex color


Gl_position is a built-in auto-declaration variable that the shader must write to the transform location to pass to it.

Void Main is the entry point for a vertex or fragment shader.

V_color = A_color;

We read the Vertex property input A_color write its vertex color output v_color.

gl_position = U_mvpmatrix * a_position;

Change the position of vertices by gl_position.

 

OpenGL ES 3.0 vertex shader (ii)

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.