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

log - ps


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 snippet 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.



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