PDA

View Full Version : range of float point numbers in the pbuffer



fqf
01-19-2004, 04:00 PM
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.

jra101
01-19-2004, 04:26 PM
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".