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.