As my project gets close to optimization stage, I notice that reducing Vertex Metadata could vastly improve the performance of 3D rendering.
Eventually, I've dearly searched around and have found following advices from stackoverflow.
Using GL_SHORT instead of GL_FLOAT in an OpenGL ES vertex array
How do you represent a normal or texture coordinate using GLshorts?
Advice on speeding up OpenGL ES 1.1 on the iPhone
Simple experiments show that switching from "FLOAT" to "SHORT" for vertex and normal isn't tough, but what troubles me is when you're to scale back verticies to their original size (with glScalef), normals are multiplied by the reciprocal of the scale. Natural remedy for this is to multiply the normals w/ scale before you submit to GPU. Then, my short normals almost become 0, because the scale factor is usually smaller than 0. Duh!
How do you use "short" for both vertex and normal at the same time? I've been trying this and that for about a full day, but I could only go for "float vertex w/ byte normal" or "short vertex w/ float normal" so far.
Your help would be truly appreciated.
Can't you just Normalise your normals by calling this?
glEnable( GL_NORMALIZE );
Its not ideal because normalising will likely hit the GPU a bit but it really depends on if your bottleneck is caused by the passing data to the GPU or by the GPU doing too much. As with any optimisation you need to figure out which gives the better speed up. I'd suspect you are probably slowed down by passing the vertex data so you WILL get a speed up.