PDA

View Full Version : frexp?



Megalomaniac
08-12-2005, 04:47 AM
Hi,
Is there (or are there any plans for) an equivalent to the HLSL function ‘frexp’ (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/HighLevelLanguageShaders/IntrinsicFunctions/frexp.asp) in GLSL?

Thanks

fenris
08-12-2005, 08:04 AM
No, but you can use this:

float frexp(float x, out float e)
{
e = ceil(log2(x));
return(x * exp2(-e));
}