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

frc - ps


Returns the fractional portion of each input component.

Syntax

frc dst, src

where

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
frcxxxxx

The following code snippet shows conceptually how the instruction operates.

dest.x = src.x - (float)floor(src.x);
dest.y = src.y - (float)floor(src.y);
dest.z = src.z - (float)floor(src.z);
dest.w = src.w - (float)floor(src.w);

The floor function converts the argument passed in to the greatest integer that is less than (or equal to) the argument. This is converted to a float and then subtracted fom the original value. The resulting fractional value ranges from 0.0 through 1.0.



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