log - vs
Microsoft DirectX 9.0 SDK Update (October 2004)

log - vs


Full precision log2(x).

Syntax

log dst, src

where

Remarks

Vertex shader versions1_12_02_x2_sw3_03_sw
logxxxxxx

The following code fragment shows the operations performed.

float v = abs(src);
if (v != 0)
{
    dest.x = dest.y = dest.z = dest.w = 
        (float)(log(v)/log(2));  
}
else
{
    dest.x = dest.y = dest.z = dest.w = -FLT_MAX;
}

This instruction accepts a scalar source whose sign bit is ignored. The result is replicated to all four channels.

This instruction provides 21 bits of precision.



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.