PDA

View Full Version : Vertex Attribute unsigned vs signed speed difference



Fitz
09-20-2006, 06:09 PM
Reading Nvidia documentation is says you should use the smallest possible data type to represent vertex attributes so that is what I did... sadly I have found using BYTE(signed or unsigned) or UNSIGNED SHORT seems to run at half speed.
I am working on terrain rendering and when I use signed shorts for the X/Z position of the data I get about 2x the performance of using unsigned shorts, this is with glVertexAttribPointer calls as glVertexPointer only uses signed.
Now I would greatly prefer to use unsigned data as all my values are positive... does anyone know why this speed difference exists? I wasted days trying to figure out why my app was so slow only to find it was just because I was using bytes and unsigned values...
I am using a geforce 6800 btw.

Komat
09-21-2006, 12:50 AM
It is possible that the hw does not support the unsigned shorts or does not support the number of components you are using (e.g. if you are using 2 ubytes).

Jackis
09-21-2006, 02:38 AM
nVidia accelerates only normalized(!!) signed and unsigned bytes and only non-normalized signed shorts.I haven't been tested integers yet, so my info is only for bytes and shorts.