PDA

View Full Version : GLdouble



dukey
01-08-2013, 02:49 PM
Does anything in opengl work with double precision ?
Ie if you load a matrix using glLoadMatrixd

would it just internally be converted to a float matrix instead of double ?

Aleksandar
01-08-2013, 03:28 PM
Yes, but no in "Legacy OpenGL". Double precision is supported through GL_ARB_gpu_shader_fp64 and GL_ARB_vertex_attrib_64bit extensions, but it requires SM5 hardware (OpenGL 4.0+) and support in driver.
I'm not aware of drivers that uses double precision for any of gl*d commands.

aqnuep
01-08-2013, 04:30 PM
It's not just gl*d commands like glLoadMatrixd aren't done using double precision in the driver, they shouldn't be done. The spec says that.

malexander
01-08-2013, 04:31 PM
Double precision computation can also be much slower than single, anywhere from 2x slower to 24x slower. And there is some GL4 hardware that doesn't support it at all (AMD 5700 series and lower, I believe). So it's a good idea to be sure that you actually need it.

Multiplying matrices on the CPU side in 64b is still a good idea though, before uploading to GL.