Part of the Khronos Group
OpenGL.org

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
    Posts
    2

    OpeGL accuracy

    Hi,
    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!
    Aureliana.

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    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.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    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
    Location
    Germany
    Posts
    325
    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
    Posts
    2
    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
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    17
    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
    Posts
    1,198
    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
    Posts
    1
    这个,我觉得吧,还是懂一些数学算法会更好点!

Posting Permissions

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