I have a 2d game that is being developed for cocos2d + iOS. For the terrain i have a tilable texture. The issue is that the terrain still looks plain.. Here is my code for wrapping the texture in the points( the form determined by the points have been triangulated). How can i apply a gradient or other indicated effects (such as shadow) ?


// we have a pointer to vertex points so enable client state
glDisable(GL_BLEND); // added by me badescuga
glBindTexture(GL_TEXTURE_2D, self.texture.name);



glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

glVertexPointer(2, GL_FLOAT, 0, areaTrianglePoints);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexCoordPointer(2, GL_FLOAT, 0, textureCoordinates);

glDrawArrays(GL_TRIANGLES, 0, areaTrianglePointCount);


glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);



//Restore texture matrix and switch back to modelview matrix
glEnableClientState(GL_COLOR_ARRAY);

glEnable(GL_BLEND); // added by me badescuga