?/TD>
Microsoft DirectX 9.0

log (Vertex Shader)


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.

Instruction Information

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.