Here is the problem, I have a ModelViewProjection(MVP) Matrix that is made from multiplying ModelView with Projection; I have made some functions that does the same thing as glOrtho and gluPerspective to get rid of the OpenGL deprecation stack feature. My functions return double values. My shaders use modelviewprojection as float. Is there any necessity on operating with double for the perspective matrixes because finaly the become floats in MVP? matrixes are made of float[16] or double[16]; If there is no notable benefit in double, then I spare some cpu resources on casting projection matrix double to float somewhere before getting in shaders.
2 Answers
2
votes
You can stick with float
.
Typical DX10/GL3.x-class hardware (such as my Geforce 9800GT) does not support double precision floating point math at all. Earlier DX9-class ATI cards did not even properly support single-precision floating point math in hardware (they supported something like fp24 or so if I remember correctly).
Nevertheless, projection works just fine in every respect on any such card. Which shows that the extra precision is not really needed in this case.