Graphics Programs Reference
After appropriately setting the arguments for glDrawArrays , we must create an
array to store the endpoints of line(s). So, inside the template you can modify the
contents of the float array pointVFA (inside initShapes method), and, to
0.5f,0.5f,0.0f} . Since this array has two points, we must call glDrawAr-
rays using glDrawArrays(GLES20.GL_LINES, 0, 2) .
Before you run this application, remove the line “ gl_PointSize = 15.0; ”
from the vertex shader. As previously stated, gl_PointSize variable is only
used with a point sprite primitive. To set the width of line primitive, call the
GLES20.glDrawArrays . The default width is 1.0.
Like vertex shaders, fragment shaders have a special kind of input variable, called
varying . They are special, because they are used to store the output of the vertex
shader, as well as the input of a fragment shader.
Varyings interpolate values across a primitive, and this becomes useful when creating