You really should not use double-precision matrices in the first place.
Up until recently GPUs only supported single- or half-precision floating-point in the programmable pipeline. In fact, for many years there was some disagreement over how many bits single-precision floating-point even had. D3D9 only required 24-bit single-precision in the pixel shader stage and AMD/ATi hardware followed that requirement pretty much until they rolled out D3D10 class GPUs (now desktop vendors all agree that single-precision is 32-bit).
This will fix your problem and save memory too:
float[] orthographic = {1.0f,0.0f, 0.0f,0.0f,
0.0f,1.0f, 0.0f,0.0f,
0.0f,0.0f,-2.0f,5.0f,
0.0f,0.0f, 0.0f,1.0f };
Having said that, yes... at the very least, that uniform needs to be declared dmat4
.
This extension (GL_ARB_gpu_shader_fp64
) introduces the necessary function to set a double-precision 4x4 matrix uniform:
glUniformMatrix4dv (...)
Incidentally, there is a different extension (GL_ARB_vertex_attrib_64bit
) necessary to use double-precision vertex attributes.
Now, since you are using Java, your actual function name and the parameters you pass will be a little bit different, but the point is you need a GPU that supports FP64 to even do this. And there is very little real-world benefit to this, Java teaches some bad habits sadly; not all of floating-point's problems can be solved by doubling the precision.