Lines Matching refs:shader

158     // Create a shader program.
178 // Create a vertex shader.
183 // Create a fragment shader.
188 // Create a shader program.
194 // Use the shader program.
559 …, and the index in the vertex shader is 0. This variable receives the vertex data from the VBO. Ea…
562 …// After a value is assigned to gl_Position in the vertex shader, the rendering pipeline further p…
569 …olor, depth, and stencil value. Each fragment is processed by a fragment shader, which also determ…
570 - A fragment shader runs on each fragment. In this example, it is used to calculate the final color…
583 …// The color here is not obtained from the vertex shader through rasterization by linear interpola…
591 1. Vertex shader processing
593 …The vertex data in the buffer is passed into the vertex shader program and undergone the following…
607 4. Fragment shader processing
609 …ed as the input variable of the fragment shader. The following operations are carried out in the f…
619 The output of the fragment shader is then undergone fragment-by-fragment processing as follows:
641 // Create a vertex shader.
646 // Create a fragment shader.
651 // Create a shader program.
657 // Use the shader program.
664shader object of a specified type and return a handle to the object. The **shaderType** parameter …
667 void glShaderSource(GLuint shader, GLsizei count, const GLchar \**string, const GLint *length);
670 The **glShaderSource** function is used to set the source code of the shader object. The following …
672 - **shader**: identifier of the shader object for which the source code is set.
678 void glCompileShader(GLuint shader);
681 …r** function is used to compile a shader object, where the **shader** parameter is the identifier …
687 The **glCreateProgram** function is used to create a shader program object and return the object id…
690 void glAttachShader(GLuint program, GLuint shader);
693shader object to a shader program object. The **program** parameter is the identifier of the targe…
699 The **glLinkProgram** function is used to link a shader program object, that is, to link the shader
701 …entifier of the target shader program object. After the shader program is linked, OpenGL merges th…
706 …sed to activate a shader program object. After **glUseProgram** is called, all rendering calls are…
711 // Compile the shader.
712 glCompileShader(shader);
715 glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
721 // Obtain the length of the shader information log.
722 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
729 // Obtain and print the shader information log.
730 glGetShaderInfoLog(shader, infoLen, NULL, infoLog);
731 esLogMessage("Error compiling shader:\n%s\n", infoLog);
737 // Delete the shader that fails to be compiled.
738 glDeleteShader(shader);
783 …vertex array. The index is bound to the attribute variable in the vertex shader. (layout (location…
795 …x 0. This array is associated with layout (location = 0) in vec3 aPos in the vertex shader program.
797 …dex** of **glVertexAttribPointer** corresponds to **aPos** in the vertex shader, that is, position…
799 …usually stored in a buffer. It is not automatically passed to the vertex shader. Therefore, the ve…