I'm writing my first game using OpenGL 2 ES (for Android), and I've currently got a particle engine and some player sprites running successfully. I'm using 4 floats for the colour of each particle which seems like total overkill. It makes sense that I should be able to use a single 32 bit int (or perhaps a single float) to hold the colours (perhaps in RGBA format) which would presumably save a lot of unnecessary loading/copying/processing, but I'm struggling to understand how I could do this.
I guess that I would need to change the shaders to take the relevant format, and also i'd need to change the way I load the color shader attribute. My fragment shader has:
varying vec4 v_Color;
gl_FragColor = v_Color * texture2D(u_TextureUnit, gl_PointCoord);
and the attribute (passed into the fragment shader from the vertex shader) is set up with:
glVertexAttribPointer(aColourLocation, COLOUR_COMPONENT_COUNT, GL_FLOAT, false, BYTES_PER_VERTEX, floatBuffer);
I've searched the documentation for what I should change vec4 and GL_FLOAT to, and what/how I'd multiply the colour with the texture, and have tried a few things but with no success.