Results 1 to 7 of 7

Thread: double precision (glDouble) useful at all or not?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    7

    double precision (glDouble) useful at all or not?

    Does working with GLdoubles improve precision at all?

    I've been having precision problems (jitter in vertex positions as well as quarted textures) and thought of switching everything to doubles.

    After a couple tests I quickly found it was twice as slow, but then I started googling about it and what I found confused me:

    Some people talk about using doubles being totally useless since everything is converted back to single precision when sent to the graphics card.

    Some other talk about opengl switching to "sofware rendering", saying it was slower, and though they said nothing about it, you can deduct the precision was effectively improved.

    So, does using glDoubles work at all?

  2. #2
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    11

    Re: double precision (glDouble) useful at all or not?

    I think it depends on driver and H/W. For the platform you are on contact the driver supplier and ask them for details.

  3. #3
    V-man
    Guest

    Re: double precision (glDouble) useful at all or not?

    http://beyond3d.com/content/news/734
    http://developer.amd.com/gpu_assets/...e%20Shader.pps
    and other such pages

    so DX11 which means SM 5.0 GPUs may or may not support double precision. Also, like the pps page says, it will be slow even if the GPU supports it.

  4. #4

    Re: double precision (glDouble) useful at all or not?

    Ok so does GLSL 1.50 support half/double data types or not?
    I'm confused, how it looks in DX10.1?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    258

    Re: double precision (glDouble) useful at all or not?

    I was under the impression the hardware only worked on floats. And double precision was essentially over kill.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649

    Re: double precision (glDouble) useful at all or not?

    Quote Originally Posted by MrKaktus
    Ok so does GLSL 1.50 support half/double data types or not?
    double: AFAIK, GLSL doesn't support double yet. NVidia hardware has supported this for about a year I think in CUDA-land (see this for instance). But I don't think that's been pushed up to GLSL.

    half: OTOH, while GLSL itself doesn't support different precision floats, NVidia GLSL has supported half types for many years. See NVidia GLSL Release Notes. This of course won't work on anything but NVidia. Also note: if you don't define #extension ### where ### >= 110, then you can get to the half* types on NVidia GLSL. Otherwise you can't. If you use half, you can use the __GLSL_CG_DATA_TYPES preprocessor symbol to conditionally map them to the float types on non-NVidia hardware.

    Also for more NV GLSL goodies, see NVidia GLSL Compiling Options. In particular, fastmath and fastprecision look interesting. Maybe one of those forces float to half?

    Quote Originally Posted by dukey
    I was under the impression the hardware only worked on floats. And double precision was essentially over kill.
    No for some apps, especially HPC/GPGPU number crunching (OpenCL/CUDA), its essential.

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649

    Re: double precision (glDouble) useful at all or not?

    Quote Originally Posted by Dark Photon
    Quote Originally Posted by MrKaktus
    Ok so does GLSL 1.50 support half/double data types or not?
    double: AFAIK, GLSL doesn't support double yet...
    More on that, for the archives. Per:

    * http://www.nvidia.com/content/GTC/videos/GTC09-1407.flv

    (skip to: 1:08:34), OpenGL SM5 support will add double support for vertex attributes, uniforms, transform feedback, and internal computations in shaders.

Similar Threads

  1. Double Precision
    By MarkoGL in forum OpenGL: Advanced Coding
    Replies: 27
    Last Post: 02-18-2011, 07:06 AM
  2. How can I simulate double precision?
    By Rui in forum OpenCL
    Replies: 2
    Last Post: 05-28-2010, 08:11 AM
  3. use double precision inside GL - AGAIN
    By narrabeenzzz in forum OpenGL: General
    Replies: 8
    Last Post: 11-07-2003, 08:44 PM
  4. single precision floats vs. double precision
    By BigD in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-02-2001, 12:24 AM
  5. Should you use double or GLdouble?
    By StudentFYP in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-19-2001, 02:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean