Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: OpeGL accuracy

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2012

    OpeGL accuracy

    I'm new in this forum and I have never dealt with OpenGL.
    It seems to be very powerful and I would like to use it for a scientific simulation of a satellite imaging system, but I'm not sure if the algorithms and numeric calculations are enough precise.
    Is OpenGL suitable for this purpose? Why?
    Thank you very much for your help!

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Montreal, Canada
    GL is just for rendering graphics. It can be used to run algorithms by using floating point buffers and readback and the float data, but it is better to use either CUDA or OpenCL (compute language) to run algorithms on a GPU.
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Member Regular Contributor
    Join Date
    Jan 2012
    OpenGL has floats and (slower) double datatypes. HiEnd GPUs support full IEEE float operations, BUT: the OpenGL specs give little guarantee about accuracy. For serious scientistic purposes OpenCL or CUDA might be a better way to go, even if those programs run on the same hardware.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2012
    the OpenGL specs give little guarantee about accuracy
    I'd like to use it only to perform an orthographic projection of the digital elevation model. Does OpenGL give little guarantee also in the accuracy of the geometric projection?

  5. #5
    Intern Newbie
    Join Date
    May 2012
    I think it depends on the graphics hardware. If you pass OpenGL a double, it will just cast it to a float again,
    if the underlining hardware doesn't support double precision.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    OpenGL can only be as accurate as the underlying hardware. If the hardware uses 16-bit floating point internally, then that's what you'll get; if it uses higher precision then you'll also get higher precision, but in general you can't rely on OpenGL alone for this kind of accuracy (what you can rely on it for is repeatability). OpenGL is also just intended for use with visualization; if you want to use OpenGL to visualize the results of a calculation (which may be done with higher precision elsewhere; e.g. a custom math library running on your CPU) then you've made a good choice. If you want to use OpenGL to actually do those calculations itself - not so good; that's outside of the problem domain that OpenGL provides a solution for.

  7. #7
    Newbie Newbie
    Join Date
    Oct 2012

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts