Graphics Programs Reference
As explained in the section “GLSL”, every fragment shader must explicitly declare
a default precision for float types, such as vec4 , which is why there is extra code
the basics of data types.)
ately setting the arguments of the glDrawArrays function. We must specify the
mode as GLES20.GL_TRIANGLES and the count as a multiple of 3 (you get an
imaginary triangle if you set the count to 0!).
Rendering a triangle primitive is left as an exercise for you, but, in case you find
this difficult, you can import the archive file gltriangle.zip from the source
code for this chapter. This will load the GL TRIANGLE application into your Eclipse
As previously mentioned, in ES 2.0 we can use a combination of the same type of
primitives to render various objects. Now, let's look at rendering a rectangle using
two triangle primitives.