Microsoft DirectX 8.0 (Visual Basic)

frc

Returns fractional portion of each input component.

frc   vDest, vSrc0

Registers

vDest
Destination register, holding the result of the operation.
vSrc0
Source register, specifying the input argument.

Operation

    SetDestReg();
    SetSrcReg(0);

    m_TmpReg.x = m_Source[0].x - (float)floor(m_Source[0].x);
    m_TmpReg.y = m_Source[0].y - (float)floor(m_Source[0].y);
    m_TmpReg.z = m_Source[0].z - (float)floor(m_Source[0].z);
    m_TmpReg.w = m_Source[0].w - (float)floor(m_Source[0].w);

    WriteResult();

Expansion

This macro takes three instruction slots.

Remarks

Each component of the result is in the range from 0.0 through 1.0.

This macro only writes x and y components.