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

Thread: range of float point numbers in the pbuffer

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Location
    Tucson, AZ, USA
    Posts
    4

    range of float point numbers in the pbuffer

    I encountered a very strange problem with the float buffer. Whenever I set a value greater than 2^16=65536 into the float pbuffer, the value read back is inf. What's the exact range of float-point numbers in the float buffer? Isn't it the same as that of float numbers in C?

    The following is the cg program I used,
    float4 main(in float4 color : COLOR, uniform float BitColor) : COLOR {
    float4 c = float4(exp2(BitColor), 0, 0, 1);
    return c;
    }


    I initialized the pbuffer as follows,
    PBuffer pbuffer("float alpha depth=24");

    and used "cgGLSetParameter1f( )" to set the paramter 'BitColor'.


    Thanks a lot in advance for help.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    591

    Re: range of float point numbers in the pbuffer

    I believe the way I wrote that PBuffer class is if you don't specify a precision it defaults to a 16-bit floating point pbuffer. Try changing your initialization string to "float=32 alpha depth=24".

Posting Permissions

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