?/TD>
Microsoft DirectX 9.0

log (Pixel Shader)


Full precision log2(x).

Syntax

log dst, src

where

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
logxxxxx

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.

Instruction Information

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.