Just so long as you're aware of the implications between floats and doubles. For most graphics-related code the amount of precision difference between floats and doubles is insignificant, and doubles are twice the size. However, that being stated a double is 8 bytes, and 10 MB can hold over 1 million doubles.
The one area where the difference between floats and doubles will be most apparent is when you mix large quantities and small quantities.
For example (I wouldn't recommend running this):
float f;
double d;
for (f = 0; f != f + 1.0f; f += 1.0f)
{
}
System.out.println(f);
for (d = 0; d != d + 1.0; d += 1.0)
{
}
System.out.println(d);
If
f and
d had infinite precision the loops would never end(because x should never equal x + 1).
However, The loops do end. The first loop ends when f ~= 1.6777216E7, and I'm still waiting for the second loop to end
(I suppose I could calculate it that d would have to be >= ~4.5E15).
Graphics libraries tend to use floats for a few different reasons:
1. Memory. Often times the amount of points/data is massive and floats are half the size. In addition to memory size, there's memory bandwidth. It will take longer to manipulate the larger memory blocks.
2. GPU limitations. Many GPU's don't support double precision math (I think this is slowly changing, but many GPU's still don't support doubles).
3. "Precedence". Basically the same reason you gave (you've noticed everyone else is doing it). Not completely invalid, precedence is a powerful tool because it keeps us from re-inventing the wheel each time. However, it is definitely worth it to occasionally understand and re-validate if other reasons for the precedence are still valid. And you're right about doubles usually being unnecessary for graphics.