Imagination PowerVR SDK Blog

native vertex structure


#1

Figure 5 of "PowerVR MBX 3D Application Development Recommendations"
recommends using interleaved arrays.  I organized my vertices as (x,y,z)
floats in one array since OpenGL-ES 1.x does not support interleaved arrays (explicitly). I understand you can get around this implicitly.

What is the PowerVR native (most efficient) way to organize the vertex data for storage in a VBO? Please forgive me if its already documented, I could not find it.

I did not see u and v in the example just color and normals.
if I am not using color, normals, and textures, would I still organize my data as if they are there. (i.e., struct { float u, v, x, y, z; int color } VS. struct { float x, y, z};

Thank you.


#2

Interleaved arrays are supported via the stride parameter to gl*Pointer. This way all data for one vertex can be contiguous in memory (as opposed to having separate arrays for each vertex attribute) which reduces page breaks and increases performance.





Use only the vertex attributes that are required, with the smallest data type that provides enough precision and range. Every attribute should start on a 4-byte boundary, i.e. you might need some padding bytes if you use BYTE or SHORT data types.





Regards,


Georg